1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update xml parsing

This commit is contained in:
Luke Pulverenti 2016-12-02 15:10:35 -05:00
parent c22321c3f9
commit 7ce49ea1e8
9 changed files with 88 additions and 78 deletions

View file

@ -14,12 +14,12 @@
}, },
"devDependencies": {}, "devDependencies": {},
"ignore": [], "ignore": [],
"version": "1.4.363", "version": "1.4.365",
"_release": "1.4.363", "_release": "1.4.365",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "1.4.363", "tag": "1.4.365",
"commit": "391923397ea7ea23890ced20153fc896e8892f31" "commit": "a946b2cfd0bc2fd99121a18cc236f1ce02ad5cf8"
}, },
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.1", "_target": "^1.2.1",

View file

@ -252,21 +252,20 @@
var rotationInterval; var rotationInterval;
var currentRotatingImages = []; var currentRotatingImages = [];
var currentRotationIndex = -1; var currentRotationIndex = -1;
function setBackdrops(items, imageSetId) { function setBackdrops(items, enableRotation) {
var images = getImageUrls(items); var images = getImageUrls(items);
imageSetId = imageSetId || new Date().getTime();
if (images.length) { if (images.length) {
startRotation(images, imageSetId); startRotation(images, enableRotation);
} else { } else {
clearBackdrop(); clearBackdrop();
} }
} }
function startRotation(images) { function startRotation(images, enableImageRotation) {
if (arraysEqual(images, currentRotatingImages)) { if (arraysEqual(images, currentRotatingImages)) {
return; return;
@ -277,7 +276,7 @@
currentRotatingImages = images; currentRotatingImages = images;
currentRotationIndex = -1; currentRotationIndex = -1;
if (images.length > 1 && enableRotation()) { if (images.length > 1 && enableRotation() && enableImageRotation !== false) {
rotationInterval = setInterval(onRotationInterval, 20000); rotationInterval = setInterval(onRotationInterval, 20000);
} }
onRotationInterval(); onRotationInterval();

View file

@ -50,13 +50,13 @@
.fab { .fab {
display: inline-flex; display: inline-flex;
border-radius: 50%; border-radius: 50%;
background-color: #444; background-color: rgb(170,170, 170);
padding: .6em; padding: .6em;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text-align: center; text-align: center;
color: #fff; color: #222;
margin: 0; margin: 0;
} }

View file

@ -14,8 +14,9 @@ define(['playbackManager', 'userSettings'], function (playbackManager, userSetti
return; return;
} }
if (enabled(items[0].MediaType)) { currentThemeIds = items.filter(function (i) {
currentThemeIds = items.map(function (i) { return enabled(i.MediaType);
}).map(function (i) {
return i.Id; return i.Id;
}); });
@ -26,7 +27,6 @@ define(['playbackManager', 'userSettings'], function (playbackManager, userSetti
}).then(function () { }).then(function () {
currentOwnerId = ownerId; currentOwnerId = ownerId;
}); });
}
} else { } else {

View file

@ -1,7 +1,3 @@
.btnUserData {
color: #aaa;
}
.btnUserDataOn { .btnUserDataOn {
color: #cc3333 !important; color: #cc3333 !important;
} }

View file

@ -196,7 +196,7 @@
.itemTag { .itemTag {
display: inline-block; display: inline-block;
background-color: #181818; background-color: #333;
border-radius: 4px; border-radius: 4px;
padding: 5px 7px; padding: 5px 7px;
margin: 0 5px 5px 0; margin: 0 5px 5px 0;
@ -257,9 +257,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
} }
.noBackdrop { .noBackdrop {
height: 170px;
background: #181818; background: #181818;
margin-top: 0 !important;
} }
.withBackdrop + .mainDrawerPanel .noBackdrop { .withBackdrop + .mainDrawerPanel .noBackdrop {
@ -460,8 +458,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
} }
.mainDetailButtons button, .recordingFields button { .mainDetailButtons button, .recordingFields button {
background: rgba(170,170, 170, 1);
color: #222;
margin-left: 0; margin-left: 0;
margin-right: .5em; margin-right: .5em;
} }
@ -538,10 +534,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
.editorMenuLink { .editorMenuLink {
display: none; display: none;
} }
.noBackdrop {
height: 80px;
}
} }
.itemMiscInfo { .itemMiscInfo {

View file

@ -74,7 +74,8 @@
queueAllFromHere: false, queueAllFromHere: false,
positionTo: button, positionTo: button,
cancelTimer: false, cancelTimer: false,
record: false record: false,
editImages: false
}; };
if (appHost.supports('sync')) { if (appHost.supports('sync')) {
@ -114,10 +115,7 @@
setInitialCollapsibleState(page, item, context, user); setInitialCollapsibleState(page, item, context, user);
renderDetails(page, item, context); renderDetails(page, item, context);
var itemBackdropElement = page.querySelector('#itemBackdrop'); backdrop.setBackdrops([item], false);
itemBackdropElement.classList.add('noBackdrop');
itemBackdropElement.style.backgroundImage = 'none';
backdrop.setBackdrops([item]);
LibraryBrowser.renderDetailPageBackdrop(page, item, imageLoader); LibraryBrowser.renderDetailPageBackdrop(page, item, imageLoader);
@ -433,7 +431,7 @@
page.querySelector('#childrenCollapsible').classList.remove('hide'); page.querySelector('#childrenCollapsible').classList.remove('hide');
renderItemsByName(page, item, user); renderItemsByName(page, item, user);
} }
else if (item.IsFolder) { else if (item.IsFolder || item.Type == 'Episode') {
if (item.Type == "BoxSet") { if (item.Type == "BoxSet") {
page.querySelector('#childrenCollapsible').classList.add('hide'); page.querySelector('#childrenCollapsible').classList.add('hide');
@ -462,14 +460,7 @@
renderMediaSources(page, user, item); renderMediaSources(page, user, item);
} }
var chapters = item.Chapters || []; renderScenes(page, item);
if (!chapters.length) {
page.querySelector('#scenesCollapsible').classList.add('hide');
} else {
page.querySelector('#scenesCollapsible').classList.remove('hide');
renderScenes(page, item, user, 3);
}
if (!item.SpecialFeatureCount || item.SpecialFeatureCount == 0 || item.Type == "Series") { if (!item.SpecialFeatureCount || item.SpecialFeatureCount == 0 || item.Type == "Series") {
page.querySelector('#specialsCollapsible').classList.add('hide'); page.querySelector('#specialsCollapsible').classList.add('hide');
@ -602,7 +593,7 @@
var dateAddedElement = page.querySelector('#dateAdded'); var dateAddedElement = page.querySelector('#dateAdded');
if (!item.IsFolder) { if (!item.IsFolder && item.Type !== 'Program' && item.Type !== 'TvChannel' && item.Type !== 'Trailer') {
dateAddedElement.classList.remove('hide'); dateAddedElement.classList.remove('hide');
dateAddedElement.innerHTML = globalize.translate('DateAddedValue', datetime.toLocaleDateString(datetime.parseISO8601Date(item.DateCreated))); dateAddedElement.innerHTML = globalize.translate('DateAddedValue', datetime.toLocaleDateString(datetime.parseISO8601Date(item.DateCreated)));
} else { } else {
@ -933,7 +924,6 @@
if (item.Tags && item.Tags.length) { if (item.Tags && item.Tags.length) {
var html = ''; var html = '';
html += '<p>' + globalize.translate('HeaderTags') + '</p>';
for (var i = 0, length = item.Tags.length; i < length; i++) { for (var i = 0, length = item.Tags.length; i < length; i++) {
html += '<div class="itemTag">' + item.Tags[i] + '</div>'; html += '<div class="itemTag">' + item.Tags[i] + '</div>';
@ -1025,6 +1015,23 @@
Fields: fields Fields: fields
}); });
} }
else if (item.Type == "Episode" && item.SeriesId && item.SeasonId) {
// Use dedicated episodes endpoint
promise = ApiClient.getEpisodes(item.SeriesId, {
seasonId: item.SeasonId,
userId: userId,
Fields: fields
});
_childrenItemsFunction = getEpisodesFunction(item.SeriesId, {
seasonId: item.SeasonId,
userId: userId,
Fields: fields
});
}
else if (item.Type == "MusicAlbum") { else if (item.Type == "MusicAlbum") {
_childrenItemsFunction = getAlbumSongsFunction(query); _childrenItemsFunction = getAlbumSongsFunction(query);
@ -1068,7 +1075,7 @@
allowBottomPadding: !scrollX allowBottomPadding: !scrollX
}); });
} }
else if (item.Type == "Season") { else if (item.Type == "Season" || item.Type == "Episode") {
html = cardBuilder.getCardsHtml({ html = cardBuilder.getCardsHtml({
items: result.Items, items: result.Items,
@ -1130,6 +1137,9 @@
if (item.Type == "Season") { if (item.Type == "Season") {
page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderEpisodes'); page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderEpisodes');
} }
else if (item.Type == "Episode") {
page.querySelector('#childrenTitle').innerHTML = item.SeriesName + ' - ' + item.SeasonName;
}
else if (item.Type == "Series") { else if (item.Type == "Series") {
page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderSeasons'); page.querySelector('#childrenTitle').innerHTML = globalize.translate('HeaderSeasons');
} }
@ -1428,6 +1438,12 @@
for (var i = 0, length = userDataIcons.length; i < length; i++) { for (var i = 0, length = userDataIcons.length; i < length; i++) {
if (item.Type == 'Program') {
userDataIcons[i].classList.add('hide');
} else {
userDataIcons[i].classList.remove('hide');
}
userdataButtons.fill({ userdataButtons.fill({
item: item, item: item,
style: 'fab-mini', style: 'fab-mini',
@ -1629,9 +1645,20 @@
}); });
} }
function renderScenes(page, item, user) { function renderScenes(page, item) {
var chapters = item.Chapters || []; var chapters = item.Chapters || [];
// If there are no chapter images, don't show a bunch of empty tiles
if (chapters.length && !chapters[0].ImageTag) {
chapters = [];
}
if (!chapters.length) {
page.querySelector('#scenesCollapsible').classList.add('hide');
} else {
page.querySelector('#scenesCollapsible').classList.remove('hide');
var scenesContent = page.querySelector('#scenesContent'); var scenesContent = page.querySelector('#scenesContent');
if (enableScrollX()) { if (enableScrollX()) {
@ -1651,6 +1678,7 @@
}); });
}); });
} }
}
function renderMediaSources(page, user, item) { function renderMediaSources(page, user, item) {

View file

@ -493,7 +493,7 @@
} else if (item.Album) { } else if (item.Album) {
html.push(item.Album); html.push(item.Album);
} else if (item.Type == 'Program' && item.EpisodeTitle) { } else if (item.Type == 'Program' && item.IsSeries) {
html.push(item.Name); html.push(item.Name);
} }

View file

@ -1,6 +1,6 @@
.raised { .ui-body-b .raised {
background: #404040; background: rgba(170,170, 170, 1);
color: #fff; color: #222;
} }
.ui-body-a .raised { .ui-body-a .raised {
@ -19,17 +19,12 @@
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2);
} }
.button-submit { .ui-body-b .button-submit {
background: #52B54B; background: #52B54B;
color: #fff; color: #fff;
} }
.ui-body-a .button-accent { .ui-body-a .button-accent, .ui-body-b .button-accent {
background: #52B54B;
color: #fff;
}
.button-accent {
background: #52B54B; background: #52B54B;
color: #fff; color: #fff;
} }