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

save sort order for movies

This commit is contained in:
Luke Pulverenti 2013-10-12 12:55:58 -04:00
parent 4ed4238b7c
commit 8020a68640
2 changed files with 40 additions and 4 deletions

View file

@ -18,6 +18,34 @@
return 20;
},
loadSavedQueryValues: function (key, query) {
var values = localStorage.getItem(key + '_' + Dashboard.getCurrentUserId());
if (values) {
values = JSON.parse(values);
return $.extend(query, values);
}
return query;
},
saveQueryValues: function (key, query) {
var values = {};
if (query.SortBy) {
values.SortBy = query.SortBy;
}
if (query.SortOrder) {
values.SortOrder = query.SortOrder;
}
localStorage.setItem(key + '_' + Dashboard.getCurrentUserId(), JSON.stringify(values));
},
getPosterDetailViewHtml: function (options) {
var items = options.items;
@ -1008,8 +1036,12 @@
else if (item.Type == "Person")
links.push('<a class="textlink" href="http://www.themoviedb.org/person/' + providerIds.Tmdb + '" target="_blank">TheMovieDB</a>');
}
if (providerIds.Tvdb)
if (providerIds.Tvdb) {
if (item.Type == "Series") {
links.push('<a class="textlink" href="http://thetvdb.com/index.php?tab=series&id=' + providerIds.Tvdb + '" target="_blank">TheTVDB</a>');
}
}
if (providerIds.Tvcom) {
if (item.Type == "Episode")
links.push('<a class="textlink" href="http://www.tv.com/shows/' + providerIds.Tvcom + '" target="_blank">TV.com</a>');

View file

@ -13,6 +13,8 @@
StartIndex: 0
};
LibraryBrowser.loadSavedQueryValues('movies', query);
function reloadItems(page) {
Dashboard.showLoadingMsg();
@ -78,6 +80,8 @@
reloadItems(page);
});
LibraryBrowser.saveQueryValues('movies', query);
Dashboard.hideLoadingMsg();
});
}