Skip to content

Commit

Permalink
Merge pull request #129 from HaveAGitGat/dev
Browse files Browse the repository at this point in the history
1.102
  • Loading branch information
HaveAGitGat authored Jan 18, 2020
2 parents 60c6caf + 84a2b30 commit 45ef24d
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 31 deletions.
13 changes: 12 additions & 1 deletion imports/ui/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,25 @@ const AppRouter = () => {

var version = GlobalSettingsDB.find({}).fetch()[0].version;

var newVersion = 1.101
var newVersion = 1.102

setVersion(newVersion)

if(version != newVersion){

alert(`
Beta v1.102 release [18th Jan 2020]:
Changes:
-[New] Plugin creator option (Filter by age) - select 'Date created' or 'Date modified'
-[New] Plugin creator option (Filter by age) - include files OLDER than specified time
-[New] Options to sort queue by date (Scanned, Created, Modified)
-[Fix] Audio file codec not showing in search results
-[Fix] MJPEG video incorrectly tagged as audio file
-[Fix] Default plugin priority
-[Fix] 'Too many packets buffered for output stream' when health checking
-[Fix] Folder path placeholder text
Beta v1.101 release [06 Dec 19]:
Changes:
-[New] Force processing of files
Expand Down
7 changes: 4 additions & 3 deletions imports/ui/libraries/tab_Libraries.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class App extends Component {
SettingsDB.insert({
name:"Library Name",
priority:count,
folder:"Path to your media files. Input a base folder and the folder browser below will show subfolders to navigate.",
folder:"",
folderValid:true,
foldersToIgnore:"",
cache:"Path to your transcode cache. Input a base folder and the folder browser below will show subfolders to navigate.",
cache:"",
cacheValid:true,
output:"Path to your output folder. Input a base folder and the folder browser below will show subfolders to navigate.",
output:"",
outputValid:true,
folderToFolderConversion:false,
folderToFolderConversionDeleteSource:false,
Expand All @@ -85,6 +85,7 @@ class App extends Component {
_id:"Tdarr_Plugin_lmg1_Reorder_Streams",
checked:true,
source:"Community",
priority:0,
}],
pluginValid:false,
pluginCommunity:true,
Expand Down
7 changes: 5 additions & 2 deletions imports/ui/libraries/tab_Libraries_Folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,7 @@ SettingsDB.insert(thisLibrary)
ref={this.props.libraryItem._id + 'f'}
name="folder"
defaultValue={this.props.libraryItem.folder}
placeholder='Path to your media files. Input a base folder and the folder browser below will show subfolders to navigate.'
onChange={this.handleChange}
></input>

Expand Down Expand Up @@ -1188,7 +1189,7 @@ SettingsDB.insert(thisLibrary)
</div>
<div id="folderList"></div>

<p>Sub-folders to ignore (e.g.: .grab,.index,User/AppData):</p>
<p>File paths containing the following will be ignored (e.g.: .grab,.index,User/AppData,-trailer,.mp4):</p>
<input
type="text"
className="folderPaths"
Expand Down Expand Up @@ -1216,6 +1217,7 @@ SettingsDB.insert(thisLibrary)
ref={this.props.libraryItem._id + 'c'}
name="cache"
defaultValue={this.props.libraryItem.cache}
placeholder='Path to your transcode cache. Input a base folder and the folder browser below will show subfolders to navigate.'
onChange={this.handleChange}
></input>

Expand Down Expand Up @@ -1361,6 +1363,7 @@ SettingsDB.insert(thisLibrary)
ref={this.props.libraryItem._id + 'o'}
name="output"
defaultValue={this.props.libraryItem.output}
placeholder='Path to your output folder. Input a base folder and the folder browser below will show subfolders to navigate.'
onChange={this.handleChange}
></input>

Expand Down Expand Up @@ -1609,7 +1612,7 @@ SettingsDB.insert(thisLibrary)

<center>
<p>
See the 'Plugins' tab guide for how the plugin stack works and for creating plugins.<b>It is best practice to put video transcode plugins at the top of your stack (below re-order streams if that's enabled).</b>
See the 'Plugins' tab guide for how the plugin stack works and for creating plugins.<b>It is best practice to put video transcode plugins at the top of your stack.</b>
</p>
</center>

Expand Down
61 changes: 50 additions & 11 deletions imports/ui/plugins/pluginTemplates/Filter/FilterByAge.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import { Button } from 'react-bootstrap';
import Checkbox from '@material-ui/core/Checkbox';
import ReactDOM from 'react-dom';


Expand All @@ -18,6 +19,8 @@ export default class App extends Component {
super(props);

this.state = {
excludeSwitch: true,
dateType: 'dateCreated'

};

Expand Down Expand Up @@ -45,18 +48,24 @@ export default class App extends Component {

var totalSeconds = (h * 3600) + (m * 60) + (s)

if (this.state.excludeSwitch === true) {

var obj = {
name: 'Filter by age',
filter: `library.filters.filterByAge(file,${totalSeconds})`,
description: `Files older than the following will be excluded from processing: ${string}`
}
var mode = 'exclude'

this.props.pushConditional(obj)
} else {

var mode = 'include'

}


var obj = {
name: 'Filter by age',
filter: `library.filters.filterByAge(file,${totalSeconds},'${mode}','${this.state.dateType}')`,
description: `Files older than the following will be ${mode}d from processing: ${string}`
}

this.props.pushConditional(obj)

}

Expand All @@ -75,11 +84,43 @@ export default class App extends Component {
<br />


<center><p>Date created<Checkbox checked={this.state.dateType == 'dateCreated' ? true : false} onChange={event => {

this.setState({
dateType: 'dateCreated'
})


}} />/ Date modified <Checkbox checked={this.state.dateType == 'dateModified' ? true : false} onChange={event => {

this.setState({
dateType: 'dateModified',
})


}} /></p> </center>

<br />


<center><p>Exclude<Checkbox checked={this.state.excludeSwitch} onChange={event => {

this.setState({
excludeSwitch: !this.state.excludeSwitch,
})

<center><p>Exclude files older than</p> </center>

}} />/ Include <Checkbox checked={!this.state.excludeSwitch} onChange={event => {

this.setState({
excludeSwitch: !this.state.excludeSwitch,
})


}} /> files older than</p> </center>
<br />

<center><p>
<center><p>

<input type="text" className="filterByDate" ref="hours" defaultValue={"0"}></input>
H{'\u00A0'}{'\u00A0'}
Expand All @@ -90,7 +131,7 @@ export default class App extends Component {
</p> </center>



<br />


Expand All @@ -104,8 +145,6 @@ export default class App extends Component {
<br />
<br />



</div>

);
Expand Down
4 changes: 2 additions & 2 deletions imports/ui/searchResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ return null
<p>Codec</p>
</div>
),
accessor: 'video_codec_name',
accessor: 'ffProbeData.streams[0].codec_name',
width: getColumnWidth(data, 'video_codec_name', 'Codec'),
getProps: (state, rowInfo, column) => {
return {
Expand Down Expand Up @@ -600,7 +600,7 @@ renderBumpButton(file) {

renderRedoButton(file, mode) {


var obj = {
[mode]: "Queued",
processingStatus: false,
Expand Down
20 changes: 19 additions & 1 deletion imports/ui/tab_Dev.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,25 @@ export default class App extends Component {

<p>Change log</p>

<p>Beta v1.101 release [06 Dec 19]:
<p>Beta v1.102 release [18th Jan 2020]:

<br />Changes:

<br />-[New] Plugin creator option (Filter by age) - select 'Date created' or 'Date modified'
<br />-[New] Plugin creator option (Filter by age) - include files OLDER than specified time
<br />-[New] Options to sort queue by date (Scanned, Created, Modified)
<br />-[Fix] Audio file codec not showing in search results
<br />-[Fix] MJPEG video incorrectly tagged as audio file
<br />-[Fix] Default plugin priority
<br />-[Fix] 'Too many packets buffered for output stream' when health checking
<br />-[Fix] Folder path placeholder text

<br />
<br />

</p>

<p>Beta v1.101 release [6th Dec 19]:

<br />Changes:

Expand Down
24 changes: 17 additions & 7 deletions imports/ui/transcoding/tab_Transcoding.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -948,17 +948,27 @@ class App extends Component {



<p>Sort queue by: </p>
<p>Oldest:
<p>Sort queue by: </p>
<p>Oldest (Scanned):
{this.renderSortBox('sortDateOldest')}
Newest:
Newest (Scanned):
{this.renderSortBox('sortDateNewest')}

Smallest:

Oldest (Created):
{this.renderSortBox('sortDateFileCreatedOldest')}
Newest (Created):
{this.renderSortBox('sortDateFileCreatedNewest')}

Oldest (Modified):
{this.renderSortBox('sortDateFileModifiedOldest')}
Newest (Modified):
{this.renderSortBox('sortDateFileModifiedNewest')}

Smallest:
{this.renderSortBox('sortSizeSmallest')}
Largest:
Largest:
{this.renderSortBox('sortSizeLargest')}
</p>
</p>


<p>Library alternation: {this.renderCheckBox('alternateLibraries')}</p>
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@ffmpeg-installer/ffmpeg": "^1.0.20",
"@material-ui/core": "^4.6.0",
"@trendmicro/react-sidenav": "^0.4.5",
"all": "0.0.0",
"babel-eslint": "^10.0.3",
"bootstrap": "^4.3.1",
"child_process": "^1.0.2",
Expand Down
3 changes: 1 addition & 2 deletions private/fileScanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,9 @@ function ffprobeLaunch(filesToScan) {

}


//if (!!("video_codec_name" in thisFileObject)) {

if (jsonString.includes('"codec_type":"video"') && !jsonString.includes('"codec_name":"mjpeg"') ) {
if (jsonString.includes('"codec_type":"video"') && thisFileObject.meta.MIMEType.includes('video')) {

updateConsole(scannerID, `Tagging video res:${filepath}`)

Expand Down
43 changes: 41 additions & 2 deletions server/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2511,7 +2511,7 @@ function launchWorkerModule(workerType) {
handBrakeMode = false
FFmpegMode = true

preset = "-v error, -f null"
preset = "-v error, -f null -max_muxing_queue_size 9999"

}

Expand Down Expand Up @@ -3688,6 +3688,9 @@ function tablesUpdate() {
//sort queues based on user preference
var globalSettings = GlobalSettingsDB.find({}, {}).fetch()


//Sort by date scanned (date createdAt in Tdarr db)

if (globalSettings[0].queueSortType == "sortDateOldest") {


Expand All @@ -3704,7 +3707,43 @@ function tablesUpdate() {
return new Date(b.createdAt) - new Date(a.createdAt);
});

} else if (globalSettings[0].queueSortType == "sortSizeSmallest") {
//Sort by date created

}else if (globalSettings[0].queueSortType == "sortDateFileCreatedOldest") {


allFilesPulledTable = allFilesPulledTable.sort(function (a, b) {
return new Date(a.statSync.ctime) - new Date(b.statSync.ctime);
});


}else if (globalSettings[0].queueSortType == "sortDateFileCreatedNewest") {


allFilesPulledTable = allFilesPulledTable.sort(function (a, b) {
return new Date(b.statSync.ctime) - new Date(a.statSync.ctime);
});

}

//Sort by date modified

else if (globalSettings[0].queueSortType == "sortDateFileModifiedOldest") {


allFilesPulledTable = allFilesPulledTable.sort(function (a, b) {
return new Date(a.statSync.mtime) - new Date(b.statSync.mtime);
});


}else if (globalSettings[0].queueSortType == "sortDateFileModifiedNewest") {


allFilesPulledTable = allFilesPulledTable.sort(function (a, b) {
return new Date(b.statSync.mtime) - new Date(a.statSync.mtime);
});

}else if (globalSettings[0].queueSortType == "sortSizeSmallest") {



Expand Down

0 comments on commit 45ef24d

Please sign in to comment.