mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-23 03:23:05 +00:00
Merge pull request #343 from WebTools-NG/#339-IMDB-ID-not-available-for-movies
#339 imdb id not available for movies
This commit is contained in:
commit
2fb68762d1
12 changed files with 183 additions and 73 deletions
|
@ -1,5 +1,9 @@
|
|||
# ![Logo](https://github.com/WebTools-NG/WebTools-NG/blob/master/src/assets/WebTools-48x48.png) WebTools-ng Change log
|
||||
|
||||
## V0.3.5
|
||||
|
||||
* [#339 IMDB ID not available for movies](https://github.com/WebTools-NG/WebTools-NG/issues/339)
|
||||
|
||||
## V0.3.4
|
||||
|
||||
* [#306 Export posters and Art](https://github.com/WebTools-NG/WebTools-NG/issues/306)
|
||||
|
|
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "webtools-ng",
|
||||
"productName": "WebTools-NG",
|
||||
"version": "0.3.4",
|
||||
"version": "0.3.5",
|
||||
"description": "WebTools Next Generation 4 Plex",
|
||||
"author": "dane22 & CPSO",
|
||||
"license": "MPL-2.0",
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
"Last Viewed at",
|
||||
"Locked Fields",
|
||||
"Loudness Analysis Version",
|
||||
"MetaData Language",
|
||||
"Mood",
|
||||
"Poster url",
|
||||
"Rating",
|
||||
|
|
|
@ -36,7 +36,6 @@
|
|||
"Last Viewed at",
|
||||
"Location",
|
||||
"Locked Fields",
|
||||
"MetaData Language",
|
||||
"Mood",
|
||||
"Original Title",
|
||||
"Poster url",
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
"Media Video Profile",
|
||||
"Media Video Resolution",
|
||||
"Media Width",
|
||||
"MetaData Language",
|
||||
"Original Title",
|
||||
"Part Accessible",
|
||||
"Part Container",
|
||||
|
@ -130,6 +129,8 @@
|
|||
"TMDB ID",
|
||||
"TMDB Link",
|
||||
"TVDB ID",
|
||||
"TVDB ID (Legacy)",
|
||||
"TVDB Language (Legacy)",
|
||||
"Updated",
|
||||
"User Rating",
|
||||
"Video Stream Anamorphic",
|
||||
|
|
|
@ -510,19 +510,40 @@
|
|||
"call": 1,
|
||||
"type": "string"
|
||||
},
|
||||
"IMDB ID (Legacy)":
|
||||
{
|
||||
"key": "$.guid",
|
||||
"call": 2,
|
||||
"type": "string",
|
||||
"postProcess": true
|
||||
},
|
||||
"IMDB ID":
|
||||
{
|
||||
"key": "$.Guid[*]",
|
||||
"call": 1,
|
||||
"call": 2,
|
||||
"type": "array",
|
||||
"subtype": "string",
|
||||
"subkey": "$.id",
|
||||
"postProcess": true
|
||||
},
|
||||
"IMDB Language (Legacy)":
|
||||
{
|
||||
"key": "$.guid",
|
||||
"call": 2,
|
||||
"type": "string",
|
||||
"postProcess": true
|
||||
},
|
||||
"IMDB Link (Legacy)":
|
||||
{
|
||||
"key": "$.guid",
|
||||
"call": 2,
|
||||
"type": "string",
|
||||
"postProcess": true
|
||||
},
|
||||
"IMDB Link":
|
||||
{
|
||||
"key": "$.Guid[*]",
|
||||
"call": 1,
|
||||
"call": 2,
|
||||
"type": "array",
|
||||
"subtype": "string",
|
||||
"subkey": "$.id",
|
||||
|
@ -1193,6 +1214,29 @@
|
|||
"subkey": "$.id",
|
||||
"postProcess": true
|
||||
},
|
||||
"TVDB ID (Legacy)":
|
||||
{
|
||||
"key": "$.guid",
|
||||
"call": 2,
|
||||
"type": "string",
|
||||
"postProcess": true
|
||||
},
|
||||
"TVDB Language (Legacy)":
|
||||
{
|
||||
"key": "$.guid",
|
||||
"call": 2,
|
||||
"type": "string",
|
||||
"postProcess": true
|
||||
},
|
||||
"TMDB ID":
|
||||
{
|
||||
"key": "$.Guid[*]",
|
||||
"call": 1,
|
||||
"type": "array",
|
||||
"subtype": "string",
|
||||
"subkey": "$.id",
|
||||
"postProcess": true
|
||||
},
|
||||
"TMDB Link":
|
||||
{
|
||||
"key": "$.Guid[*]",
|
||||
|
|
|
@ -77,7 +77,10 @@
|
|||
"Extras-trailer",
|
||||
"Genre",
|
||||
"IMDB ID",
|
||||
"IMDB ID (Legacy)",
|
||||
"IMDB Link",
|
||||
"IMDB Link (Legacy)",
|
||||
"IMDB Language (Legacy)",
|
||||
"Key",
|
||||
"Labels",
|
||||
"Last Viewed at",
|
||||
|
@ -96,8 +99,6 @@
|
|||
"Media Video Profile",
|
||||
"Media Video Resolution",
|
||||
"Media Width",
|
||||
"MetaDB Link",
|
||||
"MetaData Language",
|
||||
"Original Title",
|
||||
"Part Accessible",
|
||||
"Part Container",
|
||||
|
@ -135,10 +136,11 @@
|
|||
"Subtitle Stream Selected",
|
||||
"Subtitle Stream Title",
|
||||
"Summary",
|
||||
"TMDB ID",
|
||||
"TMDB Link",
|
||||
"Tagline",
|
||||
"Title",
|
||||
"TMDB ID",
|
||||
"TMDB Link",
|
||||
"TVDB ID",
|
||||
"Updated",
|
||||
"User Rating",
|
||||
"Video Stream Anamorphic",
|
||||
|
|
|
@ -40,8 +40,6 @@
|
|||
"Labels",
|
||||
"Location",
|
||||
"Locked Fields",
|
||||
"MetaData Language",
|
||||
"MetaDB Link",
|
||||
"Original Title",
|
||||
"Part Duration",
|
||||
"Poster url",
|
||||
|
@ -54,8 +52,11 @@
|
|||
"Summary",
|
||||
"Tagline",
|
||||
"Title",
|
||||
"TMDB ID",
|
||||
"TMDB Link",
|
||||
"TVDB ID",
|
||||
"TVDB ID (Legacy)",
|
||||
"TVDB Language (Legacy)",
|
||||
"Updated",
|
||||
"Year"
|
||||
]
|
||||
|
|
|
@ -206,6 +206,8 @@ const et = new class ET {
|
|||
subItem['title'] = JSONPath({path: '$..title', json: section})[0];
|
||||
subItem['key'] = parseInt(JSONPath({path: '$..key', json: section})[0]);
|
||||
subItem['type'] = JSONPath({path: '$..type', json: section})[0];
|
||||
subItem['scanner'] = JSONPath({path: '$..scanner', json: section})[0];
|
||||
subItem['agent'] = JSONPath({path: '$..agent', json: section})[0];
|
||||
result.push(subItem)
|
||||
}
|
||||
await Promise.resolve(result)
|
||||
|
@ -679,37 +681,6 @@ const excel2 = new class Excel {
|
|||
let x, retVal, start, strStart, end, result;
|
||||
try {
|
||||
switch ( String(name) ){
|
||||
case "MetaDB Link":
|
||||
// ["\"com.plexapp.agents.imdb://tt1291580?lang=en\""]
|
||||
// ["\"com.plexapp.agents.thetvdb://73141/17/5?lang=en\""]
|
||||
for (x=0; x<valArray.length; x++) {
|
||||
//if ( valArray[x].toString().startsWith('com.plexapp.agents.thetvdb'))
|
||||
if (valArray[x].includes("thetvdb"))
|
||||
{
|
||||
retArray.push(wtconfig.get('ET.NotAvail'))
|
||||
}
|
||||
else
|
||||
{
|
||||
retArray.push(path.basename(valArray[x].split("?")[0]))
|
||||
}
|
||||
}
|
||||
retVal = retArray.join(wtconfig.get('ET.ArraySep', ' * '))
|
||||
break;
|
||||
case "MetaData Language":
|
||||
try
|
||||
{
|
||||
for (x=0; x<valArray.length; x++) {
|
||||
retArray.push(path.basename(valArray[x].split("=")[1]))
|
||||
}
|
||||
retVal = retArray.join(wtconfig.get('ET.ArraySep', ' * '))
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
// Log error removed, since not valid if using native agents
|
||||
//log.error(`Error getting MetaData Language was ${error} for ${JSON.stringify(valArray)}`);
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
}
|
||||
break;
|
||||
case "Part File":
|
||||
for (x=0; x<valArray.length; x++) {
|
||||
retArray.push(path.basename(valArray[x]))
|
||||
|
@ -783,19 +754,57 @@ 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'))
|
||||
{
|
||||
retVal = val;
|
||||
break;
|
||||
}
|
||||
// Cut off start of string
|
||||
start = val.indexOf("tt");
|
||||
if (start == -1)
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
break;
|
||||
}
|
||||
strStart = val.substring(start);
|
||||
result = strStart.split('?')[0]
|
||||
retVal = result;
|
||||
break;
|
||||
case "IMDB Language (Legacy)":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
retVal = val;
|
||||
break;
|
||||
}
|
||||
if (val.indexOf("imdb://") == -1)
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
break;
|
||||
}
|
||||
retVal = val.split('=')[1];
|
||||
if (retVal == 'undefined')
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
}
|
||||
break;
|
||||
case "IMDB Link":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
|
@ -819,6 +828,22 @@ const excel2 = new class Excel {
|
|||
result = 'https://www.imdb.com/title/' + result;
|
||||
retVal = result;
|
||||
break;
|
||||
case "IMDB Link (Legacy)":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
retVal = val;
|
||||
break;
|
||||
}
|
||||
if (val.indexOf("imdb://") == -1)
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = 'https://imdb.com/' + val.split('//')[1];
|
||||
retVal = retVal.split('?')[0];
|
||||
}
|
||||
break;
|
||||
case "TVDB ID":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
|
@ -840,6 +865,40 @@ const excel2 = new class Excel {
|
|||
{ result = strStart.substring(7, end) }
|
||||
retVal = result;
|
||||
break;
|
||||
case "TVDB ID (Legacy)":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
retVal = val;
|
||||
break;
|
||||
}
|
||||
// Cut off start of string
|
||||
start = val.indexOf("thetvdb://");
|
||||
if (start == -1)
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
break;
|
||||
}
|
||||
strStart = val.substring(start);
|
||||
result = strStart.split('?')[0]
|
||||
retVal = result;
|
||||
break;
|
||||
case "TVDB Language (Legacy)":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
retVal = val;
|
||||
break;
|
||||
}
|
||||
if (val.indexOf("tvdb://") == -1)
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
break;
|
||||
}
|
||||
retVal = val.split('=')[1];
|
||||
if (retVal == 'undefined')
|
||||
{
|
||||
retVal = wtconfig.get('ET.NotAvail');
|
||||
}
|
||||
break;
|
||||
case "TMDB ID":
|
||||
if (val == wtconfig.get('ET.NotAvail'))
|
||||
{
|
||||
|
@ -957,6 +1016,7 @@ const excel2 = new class Excel {
|
|||
|
||||
async addRowToTmp( { libType, level, data, stream, pListType }) {
|
||||
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
|
||||
|
|
|
@ -6,7 +6,7 @@ const log = require('electron-log');
|
|||
const {JSONPath} = require('jsonpath-plus');
|
||||
|
||||
const state = {
|
||||
settings: {}
|
||||
settings: {}
|
||||
};
|
||||
|
||||
const mutations = {
|
||||
|
@ -23,31 +23,31 @@ const actions = {
|
|||
async setPMSSetting({ commit }, payload) {
|
||||
|
||||
commit
|
||||
|
||||
|
||||
let header = wtutils.PMSHeader;
|
||||
header['X-Plex-Token'] = payload.Token;
|
||||
const url = `${payload.Address}/:/prefs?${payload.Setting}=${payload.Value}`;
|
||||
const url = `${payload.Address}/:/prefs?${payload.Setting}=${payload.Value}`;
|
||||
log.debug(`Setting new setting with url ${url}`);
|
||||
await axios({
|
||||
method: 'put',
|
||||
url: url,
|
||||
url: url,
|
||||
headers: header
|
||||
})
|
||||
.then((response) => {
|
||||
log.debug('Response from setPMSSetting recieved')
|
||||
response
|
||||
.then((response) => {
|
||||
log.debug('Response from setPMSSetting recieved')
|
||||
response
|
||||
})
|
||||
.catch(function (error) {
|
||||
if (error.response) {
|
||||
if (error.response) {
|
||||
log.error('setPMSSetting: ' + error.response.data)
|
||||
alert(error.response.data.errors[0].code + " " + error.response.data.errors[0].message)
|
||||
} else if (error.request) {
|
||||
log.error('setPMSSetting: ' + error.request)
|
||||
} else {
|
||||
log.error('setPMSSetting: ' + error.message)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
async fetchPMSSettings({ commit }, payload) {
|
||||
|
@ -56,11 +56,11 @@ const actions = {
|
|||
const url = payload.Address + '/:/prefs';
|
||||
await axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
url: url,
|
||||
headers: header
|
||||
})
|
||||
.then((response) => {
|
||||
log.debug('Response from fetchPlexServers recieved')
|
||||
.then((response) => {
|
||||
log.debug('Response from fetchPlexServers recieved')
|
||||
var filteredResult = {}
|
||||
// Filtered result based on hidden, adv or all
|
||||
var curFilter = wtconfig.get('PMS.FilterSetting', 'AllSettings');
|
||||
|
@ -71,54 +71,54 @@ const actions = {
|
|||
else if (curFilter == 'OnlyHidden'){
|
||||
filteredResult = JSONPath({path: '$..Setting[?(@.hidden==true)]', json: response.data});
|
||||
}
|
||||
else {
|
||||
else {
|
||||
filteredResult = JSONPath({path: '$..Setting[?(@.advanced==true)]', json: response.data});
|
||||
}
|
||||
// Reset PMSSettings
|
||||
// Reset PMSSettings
|
||||
var PMSSettings = {};
|
||||
// Create Array for undefined
|
||||
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')] = [];
|
||||
PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')] = [];
|
||||
// Create Arrays for other categories
|
||||
filteredResult.forEach(group => {
|
||||
group = JSONPath({path: '$.group', json: group})[0]
|
||||
group = JSONPath({path: '$.group', json: group})[0]
|
||||
if (group !== "") {
|
||||
PMSSettings[group] = [];
|
||||
}
|
||||
})
|
||||
// Get the single items
|
||||
filteredResult.forEach(element => {
|
||||
// Get the single items
|
||||
filteredResult.forEach(element => {
|
||||
var id = JSONPath({path: '$.id', json: element});
|
||||
var itemGroup = JSONPath({path: '$.group', json: element});
|
||||
if (itemGroup == "")
|
||||
{
|
||||
itemGroup = i18n.t('Modules.PMS.Settings.Undefined');
|
||||
}
|
||||
var PMSSettingsItem = {}
|
||||
}
|
||||
var PMSSettingsItem = {}
|
||||
var jNode = {};
|
||||
jNode['label'] = JSONPath({path: '$.label', json: element})[0];
|
||||
jNode['summary'] = JSONPath({path: '$.summary', json: element})[0];
|
||||
jNode['type'] = JSONPath({path: '$.type', json: element})[0];
|
||||
jNode['default'] = JSONPath({path: '$.default', json: element})[0];
|
||||
jNode['value'] = JSONPath({path: '$.value', json: element})[0];
|
||||
PMSSettingsItem[id] = jNode;
|
||||
jNode['value'] = JSONPath({path: '$.value', json: element})[0];
|
||||
PMSSettingsItem[id] = jNode;
|
||||
PMSSettings[itemGroup].push(PMSSettingsItem)
|
||||
});
|
||||
});
|
||||
// Remove undefined category, if empty
|
||||
if (Object.keys(PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')]).length === 0){
|
||||
if (Object.keys(PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')]).length === 0){
|
||||
delete PMSSettings[i18n.t('Modules.PMS.Settings.Undefined')];
|
||||
}
|
||||
log.verbose(`PMS Settings are: ${JSON.stringify(PMSSettings)}`)
|
||||
log.verbose(`PMS Settings are: ${JSON.stringify(PMSSettings)}`)
|
||||
commit('UPDATE_PMS_SETTINGS', PMSSettings);
|
||||
})
|
||||
.catch(function (error) {
|
||||
if (error.response) {
|
||||
if (error.response) {
|
||||
log.error('fetchPMSSettings: ' + error.response.data)
|
||||
alert(error.response.data.errors[0].code + " " + error.response.data.errors[0].message)
|
||||
} else if (error.request) {
|
||||
log.error('fetchPMSSettings: ' + error.request)
|
||||
} else {
|
||||
log.error('fetchPMSSettings: ' + error.message)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -131,5 +131,5 @@ const serverModule = {
|
|||
actions,
|
||||
getters
|
||||
};
|
||||
|
||||
|
||||
export default serverModule;
|
|
@ -77,7 +77,7 @@ const actions = {
|
|||
const dwnlresp = await axios({
|
||||
method: 'GET',
|
||||
url: link,
|
||||
responseType: 'stream'
|
||||
responseType: 'json'
|
||||
})
|
||||
var json = JSON.stringify(dwnlresp.data);
|
||||
fs.writeFileSync(path, json);
|
||||
|
|
Loading…
Reference in a new issue