diff --git a/CHANGELOG.md b/CHANGELOG.md index c76b420..df94f3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## V0.3.8 * [#357 Default "Original Title" to "Title", if empty](https://github.com/WebTools-NG/WebTools-NG/issues/357) +* [#358 PMS page size](https://github.com/WebTools-NG/WebTools-NG/issues/358) ## V0.3.7 diff --git a/public/locales/en.json b/public/locales/en.json index 66b2dcb..8f0bedc 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -273,7 +273,18 @@ "FactoryResetConfirmBody": "Doing a Factory Reset will erase all your settings, as it was when first installed", "FactoryResetConfirmBody2": "After doing a Factory Reset, you must start {0} again", "FactoryResetBtnCancel": "Cancel", - "FactoryResetBtnOk": "Do a Factory Reset" + "FactoryResetBtnOk": "Do a Factory Reset", + "TTContainerSize": "Amount of items to fetch from the server. Warning: Increasing this will add stress to the server", + "ContainerSizeMovie": "Amount of movies (Default: 30)", + "ContainerSizeShow": "Amount of shows (Default: 30)", + "ContainerSizeEpisode": "Amount of episodes (Default: 30)", + "ContainerSizeArtist": "Amount of artists (Default: 30)", + "ContainerSizeAlbum": "Amount of albums (Default: 30)", + "ContainerSizeTrack": "Amount of tracks (Default: 30)", + "ContainerSizePhoto": "Amount of photos (Default: 30)", + "ContainerSizePlaylist": "Amount of playlists (Default: 30)", + "ContainerSizeLibraries": "Amount of libraries (Default: 30)", + "ContainerSizePlaylists": "Amount of playlists (Default: 30)" }, "PMS": { "Name": "Plex Media Server", diff --git a/src/components/modules/ExportTools/scripts/et.js b/src/components/modules/ExportTools/scripts/et.js index 9c0b091..530096b 100644 --- a/src/components/modules/ExportTools/scripts/et.js +++ b/src/components/modules/ExportTools/scripts/et.js @@ -848,23 +848,19 @@ const excel2 = new class Excel { break; } start = val.indexOf("imdb://"); - console.log('Ged2 start', start) if (start == -1) { retVal = wtconfig.get('ET.NotAvail'); break; } strStart = val.substring(start); - console.log('Ged3 strStart', strStart) end = strStart.indexOf(wtconfig.get('ET.ArraySep')); - console.log('Ged4 end', end) result = '' if (end == -1) { result = strStart.substring(7) } else { result = strStart.substring(7, end) } retVal = result; - console.log('Ged5 retVal', retVal) break; case "IMDB ID (Legacy)": if (val == wtconfig.get('ET.NotAvail')) @@ -1108,11 +1104,10 @@ const excel2 = new class Excel { } } - async addRowToTmp( { libType, level, data, stream, pListType }) { + async addRowToTmp( { libType, level, data, stream, fields }) { log.debug(`Start addRowToTmp. libType: ${libType} - level: ${level}`) log.silly(`Data is: ${JSON.stringify(data)}`) let date, year, month, day, hours, minutes, seconds - const fields = et.getFields( libType, level, pListType) let lookup, val, array, i, valArray, valArrayVal, subType, subKey let str = '' let result = '' @@ -1242,7 +1237,8 @@ const excel2 = new class Excel { } // Remove first character result = str.substr(1); - await stream.write( result + "\n"); + //await stream.write( result + "\n"); + stream.write( result + "\n"); } async sleep(ms) { @@ -1353,25 +1349,30 @@ const excel2 = new class Excel { jPath = "$.MediaContainer.Metadata[*]"; } + const bExportPosters = wtconfig.get(`ET.CustomLevels.${libType}.Posters.${level}`, false); + const bExportArt = wtconfig.get(`ET.CustomLevels.${libType}.Art.${level}`, false); + for (x=0; x setTimeout(resolve, 1)); + // await new Promise(resolve => setTimeout(resolve, 1)); } } else @@ -1387,17 +1388,17 @@ const excel2 = new class Excel { const contentsItems = await JSONPath({path: '$.MediaContainer.Metadata[*]', json: contents}); for (item of contentsItems){ store.commit("UPDATE_EXPORTSTATUS", i18n.t('Modules.ET.Status.ProcessItem', {count: counter, total: totalSize})); - if (wtconfig.get(`ET.CustomLevels.${libType}.Posters.${level}`, false)) + if (bExportPosters) { await this.exportPics( { type: 'posters', data: item, baseURL: baseURL, accessToken: accessToken } ) } - if (wtconfig.get(`ET.CustomLevels.${libType}.Art.${level}`, false)) + if (bExportArt) { await this.exportPics( { type: 'arts', data: item, baseURL: baseURL, accessToken: accessToken } ) } - await excel2.addRowToTmp( { libType: libType, level: level, data: item, stream: stream, pListType: pListType } ); + await excel2.addRowToTmp( { libType: libType, level: level, data: item, stream: stream, fields: fields } ); counter += 1; - await new Promise(resolve => setTimeout(resolve, 1)); + //await new Promise(resolve => setTimeout(resolve, 1)); } } } diff --git a/src/components/modules/General/wtutils.js b/src/components/modules/General/wtutils.js index 17c77c9..54e3d3a 100644 --- a/src/components/modules/General/wtutils.js +++ b/src/components/modules/General/wtutils.js @@ -266,7 +266,7 @@ const wtutils = new class WTUtils { wtconfig.set('PMS.ContainerSize.4', 20) } if ( wtconfig.get('PMS.ContainerSize.1', 'N/A') == 'N/A' ){ - wtconfig.set('PMS.ContainerSize.1', 20) + wtconfig.set('PMS.ContainerSize.1', 50) } if ( wtconfig.get('PMS.ContainerSize.13', 'N/A') == 'N/A' ){ wtconfig.set('PMS.ContainerSize.13', 20) diff --git a/src/components/modules/Main/GlobalSettings.vue b/src/components/modules/Main/GlobalSettings.vue index 4854f2b..8423f0a 100644 --- a/src/components/modules/Main/GlobalSettings.vue +++ b/src/components/modules/Main/GlobalSettings.vue @@ -12,9 +12,6 @@ - - - @@ -23,14 +20,14 @@ {{ $t('Modules.GlobalSettings.RestartNeeded') }} - + {{ $t('Modules.GlobalSettings.RestartNeeded') }} - + @@ -56,6 +53,76 @@ + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + + + + + {{ $t('Modules.GlobalSettings.TTContainerSize') }} + + + +
@@ -94,7 +161,17 @@ LogLevelConsole: wtconfig.get('Log.consoleLevel'), LogLevelSize: this.getLogFileSize(), BetaTester: this.getBeta(), - Update: this.getUpdate() + Update: this.getUpdate(), + ContainerSizeMovie: wtconfig.get('PMS.ContainerSize.1'), + ContainerSizeShow: wtconfig.get('PMS.ContainerSize.2'), + ContainerSizeEpisode: wtconfig.get('PMS.ContainerSize.4'), + ContainerSizeArtist: wtconfig.get('PMS.ContainerSize.8'), + ContainerSizeAlbum: wtconfig.get('PMS.ContainerSize.9'), + ContainerSizeTrack: wtconfig.get('PMS.ContainerSize.10'), + ContainerSizePhoto: wtconfig.get('PMS.ContainerSize.13'), + ContainerSizePlaylist: wtconfig.get('PMS.ContainerSize.15'), + ContainerSizeLibraries: wtconfig.get('PMS.ContainerSize.1002'), + ContainerSizePlaylists: wtconfig.get('PMS.ContainerSize.3001') } }, methods: { @@ -173,10 +250,6 @@ setTimeOut: function(){ wtconfig.set('PMS.TimeOut', this.TimeOut) }, - setLogLevel: function(value){ - log.info(`Log file level set to ${value}`) - wtconfig.set('Log.fileLevel', value) - }, setBeta: function(value){ log.info(`Beta level set to ${value}`); wtconfig.set('Update.Beta', value == i18n.t('Modules.GlobalSettings.True')); @@ -185,9 +258,9 @@ log.info(`Update set to ${value}`); wtconfig.set('Update.Update', value == i18n.t('Modules.GlobalSettings.True')); }, - setLogLevelConsole: function(value){ - log.info(`Log Console level set to ${value}`); - wtconfig.set('Log.consoleLevel', value); + setPrefs: function(value, name){ + log.info(`Update prefs for ${name} set to ${value}`); + wtconfig.set(name, value); }, getLogFileSize: function(){ const logSizeBytes = wtconfig.get('Log.maxSize'); @@ -247,6 +320,10 @@ } }, computed: { + ContainerSizes: function() { + const options = [20, 30, 40, 50, 60, 70, 80, 90, 100]; + return options; + }, logLevels: function() { const options = ['error', 'warn', 'info', 'verbose', 'debug', 'silly']; return options;