diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index bb295422eb..f6bd8c4d7c 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -685,6 +685,7 @@ class PlaybackManager { constructor() { const self = this; + // The list of players const players = []; let currentTargetInfo; let currentPairingId = null; @@ -835,6 +836,7 @@ class PlaybackManager { return ServerConnections.currentApiClient().getCurrentUser().then(function (user) { const targets = []; + // Is this relevant? targets.push({ name: globalize.translate('HeaderMyDevice'), id: 'localplayer', @@ -1977,9 +1979,12 @@ class PlaybackManager { self.translateItemsForPlayback = translateItemsForPlayback; self.getItemsForPlayback = getItemsForPlayback; + // This is the exposed function called to manage item media playback self.play = function (options) { normalizePlayOptions(options); + console.debug('playing'); + // I think this class *is* the "localpalyer", others are plugins or chromecast if (self._currentPlayer) { if (options.enableRemotePlayers === false && !self._currentPlayer.isLocalPlayer) { return Promise.reject(); @@ -1990,11 +1995,13 @@ class PlaybackManager { } } + console.debug('using "localplayer" (*wink*)'); if (options.fullscreen) { loading.show(); } if (options.items) { + console.debug('playing from options.items'); return translateItemsForPlayback(options.items, options) .then((items) => getAdditionalParts(items)) .then(function (allItems) { @@ -2002,6 +2009,7 @@ class PlaybackManager { return playWithIntros(flattened, options); }); } else { + console.debug('calling getItemsForPlayback'); if (!options.serverId) { throw new Error('serverId required!'); } @@ -3420,6 +3428,7 @@ class PlaybackManager { }; } + // Add a player to the list of players and associate callbacks function initMediaPlayer(player) { players.push(player); players.sort(function (a, b) { diff --git a/src/controllers/books/booksmain.js b/src/controllers/books/booksmain.js index 3ea6496f44..f5737b91f4 100644 --- a/src/controllers/books/booksmain.js +++ b/src/controllers/books/booksmain.js @@ -531,46 +531,11 @@ class BooksView { } function getTitle(item) { - if (params.type === 'Recordings') { - return globalize.translate('Recordings'); - } - - if (params.type === 'Programs') { - if (params.IsMovie === 'true') { - return globalize.translate('Movies'); - } - - if (params.IsSports === 'true') { - return globalize.translate('Sports'); - } - - if (params.IsKids === 'true') { - return globalize.translate('HeaderForKids'); - } - - if (params.IsAiring === 'true') { - return globalize.translate('HeaderOnNow'); - } - - if (params.IsSeries === 'true') { - return globalize.translate('Shows'); - } - - if (params.IsNews === 'true') { - return globalize.translate('News'); - } - - return globalize.translate('Programs'); - } if (params.type === 'nextup') { return globalize.translate('NextUp'); } - if (params.type === 'favoritemovies') { - return globalize.translate('FavoriteMovies'); - } - if (item) { return item.Name; } @@ -622,6 +587,7 @@ class BooksView { autoplay: true }); } else { + // This is the call we can use for resume playback getItems(self, self.params, currentItem, null, 0, 300).then(function (result) { playbackManager.play({ items: result.Items,