';
+ var autoMarkWatched = item.RunTimeTicks;
+
+ if (item.RunTimeTicks && item.RunTimeTicks >= 3000000000) {
+
+ autoMarkWatched = false;
+
+ html += '
';
}
@@ -328,19 +350,55 @@
});
+ $('.radioPlaystate', elem).on('change', function () {
+
+ if ($('#radioMarkInProgress', elem).checked()) {
+
+ $('.playstateSlider', elem).slider('enable');
+
+ } else {
+ $('.playstateSlider', elem).slider('disable');
+ }
+
+ }).trigger('change');
+
$('.btnDone', elem).on('click', function () {
$('.externalPlayerPostPlayFlyout').popup("close").remove();
ApiClient.stopActiveEncodings();
- if ($('#chkMarkWatched', elem).checked()) {
+ if ($('#radioMarkInProgress', elem).checked()) {
+
+ var pct = $(".playstateSlider", elem).val();
+ var ticks = item.RunTimeTicks * (Number(pct) * .01);
ApiClient.markPlayed(userId, item.Id, new Date());
-
}
+ else if (autoMarkWatched || $('#radioMarkWatched', elem).checked()) {
+
+ ApiClient.markPlayed(userId, item.Id, new Date());
+ }
+ else if ($('#radioMarkUnwatched', elem).checked()) {
+
+ ApiClient.markUnplayed(userId, item.Id);
+ }
+
});
+ $(".playstateSlider", elem).on("change", function (e) {
+
+ var pct = $(this).val();
+
+ var time = item.RunTimeTicks * (Number(pct) * .01);
+
+ var tooltext = Dashboard.getDisplayTime(time);
+
+ $('.sliderValue', elem).html(tooltext);
+
+ console.log("slidin", pct, self.currentDurationTicks, time);
+
+ });
}
function closePlayMenu() {
@@ -354,7 +412,7 @@
var html = '
';
html += '
';
- html += '- ' + Globalize.translate('HeaderSelectExternalPlayer') + '
';
+ html += '- ' + Globalize.translate('HeaderSelectExternalPlayer') + '
';
html += '
';
html += '
';
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 359af4b8a9..d8520cc4c1 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -160,13 +160,17 @@
if (item.MovieCount) {
- childText = item.MovieCount == 1 ? "1 movie" : item.MovieCount + " movies";
+ childText = item.MovieCount == 1 ?
+ Globalize.translate('ValueOneMovie') :
+ Globalize.translate('ValueMovieCount', item.MovieCount);
counts.push(childText);
}
if (item.TrailerCount) {
- childText = item.TrailerCount == 1 ? "1 trailer" : item.TrailerCount + " trailers";
+ childText = item.TrailerCount == 1 ?
+ Globalize.translate('ValueOneTrailer') :
+ Globalize.translate('ValueTrailerCount', item.TrailerCount);
counts.push(childText);
}
@@ -175,13 +179,17 @@
if (item.SeriesCount) {
- childText = item.SeriesCount == 1 ? "1 show" : item.SeriesCount + " shows";
+ childText = item.SeriesCount == 1 ?
+ Globalize.translate('ValueOneSeries') :
+ Globalize.translate('ValueSeriesCount', item.SeriesCount);
counts.push(childText);
}
if (item.EpisodeCount) {
- childText = item.EpisodeCount == 1 ? "1 episode" : item.EpisodeCount + " episodes";
+ childText = item.EpisodeCount == 1 ?
+ Globalize.translate('ValueOneEpisode') :
+ Globalize.translate('ValueEpisodeCount', item.EpisodeCount);
counts.push(childText);
}
@@ -190,7 +198,9 @@
if (item.GameCount) {
- childText = item.GameCount == 1 ? "1 game" : item.GameCount + " games";
+ childText = item.GameCount == 1 ?
+ Globalize.translate('ValueOneGame') :
+ Globalize.translate('ValueGameCount', item.GameCount);
counts.push(childText);
}
@@ -198,19 +208,25 @@
if (item.AlbumCount) {
- childText = item.AlbumCount == 1 ? "1 album" : item.AlbumCount + " albums";
+ childText = item.AlbumCount == 1 ?
+ Globalize.translate('ValueOneAlbum') :
+ Globalize.translate('ValueAlbumCount', item.AlbumCount);
counts.push(childText);
}
if (item.SongCount) {
- childText = item.SongCount == 1 ? "1 song" : item.SongCount + " songs";
+ childText = item.SongCount == 1 ?
+ Globalize.translate('ValueOneSong') :
+ Globalize.translate('ValueSongCount', item.SongCount);
counts.push(childText);
}
if (item.MusicVideoCount) {
- childText = item.MusicVideoCount == 1 ? "1 music video" : item.MusicVideoCount + " music videos";
+ childText = item.MusicVideoCount == 1 ?
+ Globalize.translate('ValueOneMusicVideo') :
+ Globalize.translate('ValueMusicVideoCount', item.MusicVideoCount);
counts.push(childText);
}
@@ -1317,41 +1333,16 @@
return html;
},
- isYesterday: function (date1) {
-
- var today = new Date();
- today.setDate(today.getDate() - 1);
-
- return date1.getFullYear() == today.getFullYear() && date1.getDate() == today.getDate();
-
- },
-
- isSameDay: function (date1, date2) {
-
- return date1.getFullYear() == date2.getFullYear() && date1.getDate() == date2.getDate();
-
- },
-
- getFutureDateText: function (date, includeDayNamesInFuture) {
+ getFutureDateText: function (date) {
var weekday = [];
- weekday[0] = "Sunday";
- weekday[1] = "Monday";
- weekday[2] = "Tuesday";
- weekday[3] = "Wednesday";
- weekday[4] = "Thursday";
- weekday[5] = "Friday";
- weekday[6] = "Saturday";
-
- var currentDate = new Date();
-
- if (LibraryBrowser.isSameDay(date, currentDate)) {
- return "Today";
- }
-
- if (LibraryBrowser.isYesterday(date)) {
- return "Yesterday";
- }
+ weekday[0] = Globalize.translate('OptionSunday');
+ weekday[1] = Globalize.translate('OptionMonday');
+ weekday[2] = Globalize.translate('OptionTuesday');
+ weekday[3] = Globalize.translate('OptionWednesday');
+ weekday[4] = Globalize.translate('OptionThursday');
+ weekday[5] = Globalize.translate('OptionFriday');
+ weekday[6] = Globalize.translate('OptionSaturday');
var day = weekday[date.getDay()];
date = date.toLocaleDateString();
@@ -1411,7 +1402,7 @@
}
if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) {
- name = "Special - " + name;
+ name = Globalize.translate('ValueSpecialEpisodeName', name);
} else if (item.Type == "Episode" && item.IndexNumber != null && item.ParentIndexNumber != null) {
@@ -1439,7 +1430,7 @@
getOfflineIndicatorHtml: function (item) {
if (item.LocationType == "Offline") {
- return '
Offline
';
+ return '
' + Globalize.translate('HeaderOffline') + '
';
}
try {
@@ -1447,7 +1438,7 @@
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
if (item.PremiereDate && (new Date().getTime() < date.getTime())) {
- return '
Unaired
';
+ return '
' + Globalize.translate('HeaderUnaired') + '
';
}
} catch (err) {
@@ -1456,7 +1447,7 @@
if (item.IsFolder) {
return '';
}
- return '
Missing
';
+ return '
' + Globalize.translate('HeaderMissing') + '
';
},
getPlayedIndicatorHtml: function (item) {
@@ -1596,9 +1587,11 @@
if (item.SeriesName && item.Type == "Season") {
html.push('
' + item.SeriesName + '');
+
} else if (item.ParentIndexNumber != null && item.Type == "Episode") {
- html.push('
Season ' + item.ParentIndexNumber + '');
+ html.push('
' + item.SeasonName + '');
+
} else if (item.Album && item.Type == "Audio" && (item.AlbumId || item.ParentId)) {
html.push('
' + item.Album + '');
@@ -1624,7 +1617,7 @@
var links = [];
if (item.HomePageUrl) {
- links.push('
Website');
+ links.push('
' + Globalize.translate('ButtonWebsite') + '');
}
if (item.ExternalUrls) {
@@ -1639,7 +1632,9 @@
if (links.length) {
- var html = 'Links: ' + links.join(' / ');
+ var html = links.join(' / ');
+
+ html = Globalize.translate('ValueLinks', html);
$(linksElem).html(html).trigger('create');
@@ -1689,9 +1684,9 @@
if (showControls) {
- html += '
';
+ html += '
';
- html += '
';
+ html += '
';
}
html += (options.additionalButtonsHtml || '');
@@ -1702,7 +1697,7 @@
if (options.viewButton) {
- html += '
';
+ html += '
';
}
html += '
';
@@ -1724,7 +1719,7 @@
}).join('');
// Add styles to defeat jquery mobile
- html += '
';
+ html += '
';
}
}
@@ -1762,9 +1757,9 @@
if (showControls) {
html += '
';
- html += '';
+ html += '';
- html += '';
+ html += '';
html += '
';
if (showLimit !== false) {
@@ -1790,7 +1785,7 @@
}
// Add styles to defeat jquery mobile
- html += '
';
+ html += '
';
}
}
@@ -1814,9 +1809,9 @@
if (item.CriticRating != null) {
if (item.CriticRating >= 60) {
- html += '
';
+ html += '
';
} else {
- html += '
';
+ html += '
';
}
html += '
' + item.CriticRating + '%
';
@@ -1864,31 +1859,38 @@
var itemId = item.Id;
var type = item.Type;
+ var tooltipPlayed = Globalize.translate('TooltipPlayed');
+
if ((item.MediaType || item.IsFolder) && item.Type != "TvChannel" && item.Type != "MusicArtist") {
if (userData.Played) {
- html += '
';
+ html += '
';
} else {
- html += '
';
+ html += '
';
}
}
+ var tooltipLike = Globalize.translate('TooltipLike');
+ var tooltipDislike = Globalize.translate('TooltipDislike');
+
if (typeof userData.Likes == "undefined") {
- html += '
';
- html += '
';
+ html += '
';
+ html += '
';
}
else if (userData.Likes) {
html += '
';
- html += '
';
+ html += '
';
}
else {
html += '
';
- html += '
';
+ html += '
';
}
+ var tooltipFavorite = Globalize.translate('TooltipFavorite');
if (userData.IsFavorite) {
- html += '
';
+
+ html += '
';
} else {
- html += '
';
+ html += '
';
}
return html;
@@ -2142,7 +2144,7 @@
if (item.ProductionYear && item.Type == "Series") {
if (item.Status == "Continuing") {
- miscInfo.push(item.ProductionYear + "-Present");
+ miscInfo.push(Globalize.translate('ValueSeriesYearToPresent', item.ProductionYear));
}
else if (item.ProductionYear) {
@@ -2241,8 +2243,7 @@
if (item.Studios && item.Studios.length && item.Type != "Series") {
- var prefix = item.Studios.length > 1 ? "Studios" : "Studio";
- var html = prefix + ': ';
+ var html = '';
for (var i = 0, length = item.Studios.length; i < length; i++) {
@@ -2253,6 +2254,10 @@
html += '
' + item.Studios[i].Name + '';
}
+ var translationKey = item.Studios.length > 1 ? "ValueStudios" : "ValueStudio";
+
+ html = Globalize.translate(translationKey, html);
+
elem.show().html(html).trigger('create');
@@ -2291,9 +2296,10 @@
var date = parseISO8601Date(item.PremiereDate, { toLocal: true });
- var text = new Date().getTime() > date.getTime() ? "Premiered" : "Premieres";
+ var translationKey = new Date().getTime() > date.getTime() ? "ValuePremiered" : "ValuePremieres";
+
+ elem.show().html(Globalize.translate(translationKey, date.toLocaleDateString()));
- elem.show().html(text + ' ' + date.toLocaleDateString());
} catch (err) {
elem.hide();
}
@@ -2303,18 +2309,20 @@
},
renderBudget: function (elem, item) {
+
if (item.Budget) {
- elem.show().html('Budget: $
' + item.Budget + '');
+ elem.show().html(Globalize.translate('ValueBudget', '$' + item.Budget));
} else {
elem.hide();
}
},
renderRevenue: function (elem, item) {
+
if (item.Revenue) {
- elem.show().html('Revenue: $
' + item.Revenue + '');
+ elem.show().html(Globalize.translate('ValueRevenue', '$' + item.Revenue));
} else {
elem.hide();
}
@@ -2322,7 +2330,7 @@
renderAwardSummary: function (elem, item) {
if (item.AwardSummary) {
- elem.show().html('Awards: ' + item.AwardSummary);
+ elem.show().html(Globalize.translate('ValueAwards', item.AwardSummary));
} else {
elem.hide();
}
@@ -2505,7 +2513,7 @@
html += '