mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Saving notes, moving computers
This commit is contained in:
parent
b5445515c8
commit
29b7071be7
2 changed files with 10 additions and 35 deletions
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue