diff --git a/web/directives/plex-library.js b/web/directives/plex-library.js index 2e32c3f..272d783 100644 --- a/web/directives/plex-library.js +++ b/web/directives/plex-library.js @@ -10,6 +10,7 @@ module.exports = function (plex, dizquetv, $timeout) { limit: "@limit", }, link: function (scope, element, attrs) { + scope.errors=[]; if ( typeof(scope.limit) == 'undefined') { scope.limit = 1000000000; } @@ -45,8 +46,12 @@ module.exports = function (plex, dizquetv, $timeout) { await scope.wait(0); scope.pending += 1; try { - item.streams = await plex.getStreams(scope.plexServer, item.key) + item.streams = await plex.getStreams(scope.plexServer, item.key, scope.errors) scope.selection.push(JSON.parse(angular.toJson(item))) + } catch (err) { + let msg = "Unable to add item: " + item.key + " " + item.title; + scope.errors.push(msg); + console.error(msg, err); } finally { scope.pending -= 1; } @@ -99,7 +104,7 @@ module.exports = function (plex, dizquetv, $timeout) { } scope.fillNestedIfNecessary = async (x, isLibrary) => { if ( (typeof(x.nested) === 'undefined') && (x.type !== 'collection') ) { - x.nested = await plex.getNested(scope.plexServer, x.key, isLibrary); + x.nested = await plex.getNested(scope.plexServer, x.key, isLibrary, scope.errors); } } scope.getNested = (list, isLibrary) => { diff --git a/web/public/templates/plex-library.html b/web/public/templates/plex-library.html index 4270bce..a95c9c1 100644 --- a/web/public/templates/plex-library.html +++ b/web/public/templates/plex-library.html @@ -107,6 +107,8 @@
Selected Items
{{ selection.length }} elements added in total. Only the last 10 elements are displayed:
+
{{ e }}
+