1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Techywarrior 2013-04-09 22:00:23 -07:00
commit 867a549058
8 changed files with 56 additions and 13 deletions

View file

@ -175,3 +175,14 @@
.mediaInfoLabel { .mediaInfoLabel {
color: #bbb; color: #bbb;
} }
.posterRibbon {
display: block;
position: absolute;
top: 0;
right: 0;
text-align: center;
background-color: #008FBB;
padding: 3px 10px;
border-bottom-left-radius: 10px;
}

View file

@ -407,7 +407,7 @@ form, .readOnlyContent {
display: inline-block; display: inline-block;
margin: 5px; margin: 5px;
text-align: center; text-align: center;
font-size: 15px; font-size: 14px;
padding: 0; padding: 0;
position: relative; position: relative;
padding-bottom: 28px; padding-bottom: 28px;

View file

@ -7,7 +7,7 @@
SortOrder: "Ascending", SortOrder: "Ascending",
IncludeItemTypes: "BoxSet", IncludeItemTypes: "BoxSet",
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,ItemCounts" Fields: "PrimaryImageAspectRatio,ItemCounts,ItemCounts,DateCreated"
}; };

View file

@ -1,13 +1,13 @@
var LibraryBrowser = { var LibraryBrowser = {
getDetaultPageSize: function() { getDetaultPageSize: function () {
if (window.location.toString().toLowerCase().indexOf('localhost') != -1) { if (window.location.toString().toLowerCase().indexOf('localhost') != -1) {
return 100; return 100;
} }
return 25; return 25;
}, },
getPosterViewHtml: function (options) { getPosterViewHtml: function (options) {
var items = options.items; var items = options.items;
@ -35,7 +35,7 @@
height: 198, height: 198,
width: 352, width: 352,
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}) + "' />"; }) + "' />";
} else if (hasPrimaryImage) { } else if (hasPrimaryImage) {
@ -47,7 +47,7 @@
height: height, height: height,
width: width, width: width,
tag: item.ImageTags.Primary tag: item.ImageTags.Primary
}) + "' />"; }) + "' />";
} else if (item.BackdropImageTags && item.BackdropImageTags.length) { } else if (item.BackdropImageTags && item.BackdropImageTags.length) {
@ -56,7 +56,7 @@
height: 198, height: 198,
width: 352, width: 352,
tag: item.BackdropImageTags[0] tag: item.BackdropImageTags[0]
}) + "' />"; }) + "' />";
} }
else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") { else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") {
@ -78,6 +78,10 @@
html += "</div>"; html += "</div>";
} }
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>"; html += "</a></div>";
} }
@ -153,6 +157,10 @@
html += "</div>"; html += "</div>";
} }
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>"; html += "</a></div>";
} }
@ -220,12 +228,34 @@
html += "</div>"; html += "</div>";
} }
if (options.showNewIndicator !== false) {
html += LibraryBrowser.getNewIndicatorHtml(item);
}
html += "</a></div>"; html += "</a></div>";
} }
return html; return html;
}, },
getNewIndicatorHtml: function (item) {
if (item.RecentlyAddedItemCount) {
return '<div class="posterRibbon">' + item.RecentlyAddedItemCount + ' New</div>';
}
if (!item.IsFolder) {
var date = item.DateCreated;
if (date && (new Date().getTime() - parseISO8601Date(date).getTime()) < 1209600000) {
return "<div class='posterRibbon'>New</div>";
}
}
return '';
},
getAveragePrimaryImageAspectRatio: function (items) { getAveragePrimaryImageAspectRatio: function (items) {
var values = []; var values = [];

View file

@ -9,7 +9,7 @@
SortOrder: "Ascending", SortOrder: "Ascending",
IncludeItemTypes: "Movie", IncludeItemTypes: "Movie",
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,UserData,DisplayMediaType", Fields: "PrimaryImageAspectRatio,UserData,DisplayMediaType,ItemCounts,DateCreated",
Limit: LibraryBrowser.getDetaultPageSize(), Limit: LibraryBrowser.getDetaultPageSize(),
StartIndex: 0 StartIndex: 0
}; };

View file

@ -19,7 +19,8 @@
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({ $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items, items: result.Items,
useAverageAspectRatio: true useAverageAspectRatio: true,
showNewIndicator: false
})); }));
}); });
@ -59,7 +60,7 @@
IncludeItemTypes: "Trailer", IncludeItemTypes: "Trailer",
Limit: 5, Limit: 5,
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio", Fields: "PrimaryImageAspectRatio,DateCreated",
Filters: "IsUnplayed" Filters: "IsUnplayed"
}; };

View file

@ -19,7 +19,8 @@
$('#recentlyAddedItems', page).html(LibraryBrowser.getEpisodePosterViewHtml({ $('#recentlyAddedItems', page).html(LibraryBrowser.getEpisodePosterViewHtml({
items: result.Items, items: result.Items,
useAverageAspectRatio: true useAverageAspectRatio: true,
showNewIndicator: false
})); }));
}); });
@ -33,7 +34,7 @@
Filters: "IsResumable", Filters: "IsResumable",
Limit: 6, Limit: 6,
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo" Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated"
}; };
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {

View file

@ -7,7 +7,7 @@
SortOrder: "Ascending", SortOrder: "Ascending",
IncludeItemTypes: "Series", IncludeItemTypes: "Series",
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo" Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated"
}; };
function getTableHtml(items) { function getTableHtml(items) {