diff --git a/package.json b/package.json index cdaf0f4..89d2e6e 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,8 @@ "version": "0.1.2", "description": "WebTools Next Generation 4 Plex", "author": "dane22 & CPSO", + "license": "MPL-2.0", + "homepage": "https://github.com/WebTools-NG/WebTools-NG", "private": true, "scripts": { "serve": "vue-cli-service electron:serve", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index df36fcf..0000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/locales/en.json b/public/locales/en.json index d0fbc62..f5650d7 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -105,6 +105,7 @@ "RadioMovies": "Movies", "RadioTVSeries": "TV Series", "RadioTVEpisodes": "TV Episodes", + "RadioTVShowEpisodes": "TV Shows and Episodes", "RadioMusic": "Music", "RadioPhotos": "Photos", "RadioOtherVideos": "Other Videos", diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index f3d2503..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/components/modules/ExportTools/Export.vue b/src/components/modules/ExportTools/Export.vue index 64c3aeb..24742c0 100644 --- a/src/components/modules/ExportTools/Export.vue +++ b/src/components/modules/ExportTools/Export.vue @@ -105,7 +105,9 @@ selLevelName: "", optionsMediaType: [ { text: i18n.t('Modules.ET.RadioMovies'), value: 'movie', disabled: false }, - { text: i18n.t('Modules.ET.RadioTVSeries'), value: 'show', disabled: true }, + { text: i18n.t('Modules.ET.RadioTVSeries'), value: 'show', disabled: true }, + { text: i18n.t('Modules.ET.RadioTVEpisodes'), value: 'episode', disabled: false }, + { text: i18n.t('Modules.ET.RadioTVShowEpisodes'), value: 'showepisode', disabled: true }, { text: i18n.t('Modules.ET.RadioMusic'), value: 'artist', disabled: true }, { text: i18n.t('Modules.ET.RadioPhotos'), value: 'photo', disabled: true }, { text: i18n.t('Modules.ET.RadioOtherVideos'), value: 'other', disabled: true } @@ -139,9 +141,10 @@ return this.$store.getters.getSelectedServerAddressUpdateInProgress }, exportLevels: function() { - et.getLevelDisplayName('My Level', this.selMediaType) + et.getLevelDisplayName('My Level', this.selMediaType); // Returns valid levels for selected media type - const etLevel = et.getLevels(this.selMediaType); + let targetType = this.selMediaType; + const etLevel = et.getLevels(targetType); const etCustomLevel = et.getCustomLevels(this.selMediaType); const options = [] const item = {} @@ -183,15 +186,20 @@ } }, methods: { - getPMSSections: async function(){ - + getPMSSections: async function(){ this.selLibrary = "Loading..."; await this.$store.dispatch('fetchSections') const sections = await this.$store.getters.getPmsSections; - const result = []; + const result = []; + // If episodes, we need to show shows + let targetType = this.selMediaType; + if (targetType == 'episode') + { + targetType = 'show' + } if (Array.isArray(sections) && sections.length) { sections.forEach(req => { - if (req.type == this.selMediaType) { + if (req.type == targetType) { log.debug(`pushing library: ${req.title} to results`); let item = []; item['text']=req.title; @@ -216,7 +224,8 @@ changeType: function() { // Triggers when lib type is changed this.selLibrary = ''; - this.selLevel = ''; + this.selLevel = ''; + this.getPMSSections(); this.$store.commit("UPDATE_SELECTEDLIBTYPE", this.selMediaType); }, selectExportLevel: function() { diff --git a/src/components/modules/ExportTools/definitions.json b/src/components/modules/ExportTools/definitions.json index d35fc90..ef78ac3 100644 --- a/src/components/modules/ExportTools/definitions.json +++ b/src/components/modules/ExportTools/definitions.json @@ -1134,6 +1134,7 @@ "episode": { "levels": { "Level 1": "level1", + "Level 2": "level2", "Tommy": "tommy" }, "LevelCount": { @@ -1147,12 +1148,64 @@ }, "level": { "tommy": [ - "Title", - "Part Duration" + "Media ID" + + + ], + "verified": [ + "Series Title", + "Episode Sort Title", + "Episode Title", + "Year", + "Season", + "Episode", + "Content Rating", + "Summary", + "Rating", + "User Rating" + + ], + "Clear Fields": [ + + "Writers", + "Duration", + "Added", + "Updated", + "Poster url", + "Collection", + "Locked Fields", + "View Count" + ], + "Invalid, belongs to shows": [ + "Studio", + "Originally Aired", + "Directors" + ], "level1": [ - + "Media ID", + "Series Title", + "Episode Sort Title", + "Episode Title", + "Year", + "Season", + "Episode", + "Content Rating", + "Summary", + "Rating", + "User Rating" + ], + "level2": [ + "Writers", + "Duration", + "Added", + "Updated", + "Poster url", + "Collection", + "Locked Fields", + "View Count" ] + }, "fields": { "Media ID": @@ -1220,7 +1273,33 @@ "key": "$.userRating", "call": 1, "type": "string" - } + }, + "Studio": + { + "key": "$.studio", + "call": 1, + "type": "string" + }, + "Originally Aired": + {}, + "Directors": + {}, + "Writers": + {}, + "Duration": + {}, + "Added": + {}, + "Updated": + {}, + "Poster url": + {}, + "Collection": + {}, + "Locked Fields": + {}, + "View Count": + {} } diff --git a/src/components/modules/ExportTools/et.js b/src/components/modules/ExportTools/et.js index 83fe37a..a862575 100644 --- a/src/components/modules/ExportTools/et.js +++ b/src/components/modules/ExportTools/et.js @@ -25,7 +25,7 @@ const et = new class ET { async getSectionData({sectionName, baseURL, accessToken, libType}) { const sectionData = [] - log.info(`Starting getSectionData with Name: ${sectionName}`) + log.info(`Starting getSectionData with Name: ${sectionName} and with a type of: ${libType}`) // Get Section Key const libKey = await et.getSectionKey({libName: sectionName, baseURL: baseURL, accessToken: accessToken}) log.debug(`Get SectionKey as: ${libKey}`) @@ -42,7 +42,14 @@ const et = new class ET { const element = '/library/sections/' + libKey let size do { - postURI = `/all?X-Plex-Container-Start=${idx}&X-Plex-Container-Size=${step}`; + postURI = `/all?X-Plex-Container-Start=${idx}&X-Plex-Container-Size=${step}`; + if (libType == 'episode') + { + console.log('Ged Episodes needed, so adding the type') + console.log('Ged url called: ' + baseURL + element + postURI) + postURI += '&type=4' + } + console.log('GED postURI: ' + postURI) chuncks = await et.getItemData({baseURL: baseURL, accessToken: accessToken, element: element, postURI: postURI}); size = JSONPath({path: '$.MediaContainer.size', json: chuncks}); log.verbose(`getSectionData chunck size is ${size} and idx is ${idx}`) @@ -89,7 +96,8 @@ const et = new class ET { } getRealLevelName(level, libType) { - // First get the real name of the level, and not just the display name + // First get the real name of the level, and not just the display name + console.log('GED getRealLevelName LibType: ' + libType) const levelName = def[libType]['levels'][level] return levelName } @@ -121,7 +129,7 @@ const et = new class ET { } getLevelDisplayName(level, libType){ - // return displayname fort with buildin levels + // return displayname for the buildin levels const levels = et.getLevels(libType) let result = ''; loop1: @@ -163,7 +171,8 @@ const et = new class ET { getLevelFields(level, libType) { // return fields in a level - const out = [] + const out = [] + console.log('GED getLevelFields LibType: ' + libType) const levels = def[libType]['level'][et.getRealLevelName(level, libType)] Object.keys(levels).forEach(function(key) { out.push(levels[key]) @@ -180,7 +189,8 @@ const et = new class ET { getLevels(libType) { // Returns an json of levels for a selected type og medias, like 'movie' - const levels = def[libType]['levels'] + const levels = def[libType]['levels'] + console.log('GED getLevels LibType: ' + libType) log.debug('ET LevelNames: ' + JSON.stringify(levels)) return levels } @@ -196,6 +206,7 @@ const et = new class ET { getLevelKeys(libType){ // Only return the keys for possible levels const out = [] + console.log('GED getLevelKeys LibType: ' + libType) const levels = def[libType]['levels'] Object.keys(levels).forEach(function(key) { out.push(key) @@ -483,7 +494,8 @@ const excel2 = new class Excel { } async addRowToTmp( { libType, level, data, stream }) { - // log.debug(`Start addRowToTmp. libType: ${libType} - level: ${level}`) + log.debug(`Start addRowToTmp. libType: ${libType} - level: ${level}`) + console.log('Ged data: ' + JSON.stringify(data)) let date, year, month, day, hours, minutes, seconds const fields = et.getFields( libType, level) let lookup, val, array, i, valArray, valArrayVal, subType, subKey @@ -491,7 +503,8 @@ const excel2 = new class Excel { let result = '' for (var x=0; x { - // config - // .plugin('html') - // .tap(args => { - // let v = JSON.stringify(require('./package.json').version) - // args[0]['process.env']['VERSION'] = v - // return args; - // }) - // } }