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

fixes #592 - Add options to import missing and future episodes

This commit is contained in:
Luke Pulverenti 2013-10-16 19:35:11 -04:00
parent 6d4e555bb8
commit b23426bb93
13 changed files with 167 additions and 18 deletions

View file

@ -30,7 +30,7 @@
$('#offlineIndicator', page).hide();
}
if (MediaPlayer.canPlay(item) && item.LocationType !== "Offline") {
if (MediaPlayer.canPlay(item) && item.LocationType !== "Offline" && item.LocationType !== "Virtual") {
$('#playButtonContainer', page).show();
} else {
$('#playButtonContainer', page).hide();

View file

@ -12,8 +12,8 @@
Fields: "DateCreated,SeriesInfo",
StartIndex: 0
};
LibraryBrowser.loadSavedQueryValues('episodes', query);
LibraryBrowser.loadSavedQueryValues('episodes', query);
function reloadItems(page) {
@ -61,13 +61,25 @@
query.StartIndex = 0;
reloadItems(page);
});
LibraryBrowser.saveQueryValues('episodes', query);
LibraryBrowser.saveQueryValues('episodes', query);
Dashboard.hideLoadingMsg();
});
}
function formatDigit(i) {
return i < 10 ? "0" + i : i;
}
function getDateFormat(date) {
// yyyyMMddHHmmss
var d = date;
return "" + d.getFullYear() + formatDigit(d.getMonth() + 1) + formatDigit(d.getDate()) + formatDigit(d.getHours()) + formatDigit(d.getMinutes()) + formatDigit(d.getSeconds());
}
$(document).on('pageinit', "#episodesPage", function () {
var page = this;
@ -166,6 +178,24 @@
reloadItems(page);
});
$('#chkMissingEpisode', this).on('change', function () {
query.LocationTypes = this.checked ? "virtual" : null;
query.MaxPremiereDate = this.checked ? getDateFormat(new Date()) : null;
query.HasPremiereDate = this.checked ? true : null;
reloadItems(page);
});
$('#chkFutureEpisode', this).on('change', function () {
query.LocationTypes = this.checked ? "virtual" : null;
query.MinPremiereDate = this.checked ? getDateFormat(new Date()) : null;
query.HasPremiereDate = this.checked ? true : null;
reloadItems(page);
});
$('.alphabetPicker', this).on('alphaselect', function (e, character) {
query.NameStartsWithOrGreater = character;
@ -229,10 +259,10 @@
$('#chkSubtitle', this).checked(query.HasSubtitles == true).checkboxradio('refresh');
$('#chkTrailer', this).checked(query.HasTrailer == true).checkboxradio('refresh');
$('#chkSpecialFeature', this).checked(query.HasSpecialFeature == true).checkboxradio('refresh');
$('#chkThemeSong', this).checked(query.HasThemeSong == true).checkboxradio('refresh');
$('#chkThemeVideo', this).checked(query.HasThemeVideo == true).checkboxradio('refresh');
$('#chkSpecialFeature', this).checked(query.ParentIndexNumber == 0).checkboxradio('refresh');
$('#chkMissingEpisode', this).checked(query.LocationTypes == "virtual").checkboxradio('refresh');
$('.alphabetPicker', this).alphaValue(query.NameStartsWithOrGreater);

View file

@ -842,6 +842,10 @@
},
getNewIndicatorHtml: function (item) {
if (item.LocationType == 'Virtual') {
return '';
}
if (item.Type == "Season") {
if (item.RecursiveUnplayedItemCount) {
return '<div class="posterRibbon">' + item.RecursiveUnplayedItemCount + ' New</div>';
@ -1785,7 +1789,7 @@
renderStudios: function (elem, item, context) {
if (item.Studios && item.Studios.length) {
if (item.Studios && item.Studios.length && item.Type != "Series") {
var prefix = item.Studios.length > 1 ? "Studios" : "Studio";
var html = prefix + ':&nbsp;&nbsp;';

View file

@ -43,7 +43,6 @@
$('#selectLanguage', page).val(config.PreferredMetadataLanguage).selectmenu("refresh");
$('#selectCountry', page).val(config.MetadataCountryCode).selectmenu("refresh");
$('#chkEnableInternetProviders', page).checked(config.EnableInternetProviders).checkboxradio("refresh");
$('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
$('#chkEnableTmdbPersonUpdates', page).checked(config.EnableTmdbUpdates).checkboxradio("refresh");
Dashboard.hideLoadingMsg();
@ -89,7 +88,6 @@
ApiClient.getServerConfiguration().done(function (config) {
config.EnableTmdbUpdates = $('#chkEnableTmdbPersonUpdates', form).checked();
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.EnableInternetProviders = $('#chkEnableInternetProviders', form).checked();
config.SaveLocalMeta = $('#chkSaveLocal', form).checked();
config.MetadataRefreshDays = $('#txtRefreshDays', form).val();

View file

@ -0,0 +1,52 @@
var MetadataTVPage = {
onPageShow: function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (result) {
MetadataTVPage.load(page, result);
});
},
load: function (page, config) {
var chkEnableTvdbUpdates = $('#chkEnableTvdbUpdates', page).checked(config.EnableTvDbUpdates).checkboxradio("refresh");
var chkCreateMissingEpisodes = $('#chkCreateMissingEpisodes', page).checked(config.CreateVirtualMissingEpisodes).checkboxradio("refresh");
var chkCreateFutureEpisodes = $('#chkCreateFutureEpisodes', page).checked(config.CreateVirtualFutureEpisodes).checkboxradio("refresh");
if (config.EnableInternetProviders) {
chkEnableTvdbUpdates.checkboxradio("enable");
chkCreateMissingEpisodes.checkboxradio("enable");
chkCreateFutureEpisodes.checkboxradio("enable");
} else {
chkEnableTvdbUpdates.checkboxradio("disable");
chkCreateMissingEpisodes.checkboxradio("disable");
chkCreateFutureEpisodes.checkboxradio("disable");
}
Dashboard.hideLoadingMsg();
},
onSubmit: function () {
var form = this;
Dashboard.showLoadingMsg();
ApiClient.getServerConfiguration().done(function (config) {
config.EnableTvDbUpdates = $('#chkEnableTvdbUpdates', form).checked();
config.CreateVirtualMissingEpisodes = $('#chkCreateMissingEpisodes', form).checked();
config.CreateVirtualFutureEpisodes = $('#chkCreateFutureEpisodes', form).checked();
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
};
$(document).on('pageshow', "#metadataTvPage", MetadataTVPage.onPageShow);

View file

@ -288,7 +288,7 @@
browseButtonContainer.show();
if (item.Type != 'Person' && item.Type != 'Genre' && item.Type != 'Studio' && item.Type != 'GameGenre' && item.Type != 'MusicGenre') {
if (item.Type != 'Person' && item.Type != 'Genre' && item.Type != 'Studio' && item.Type != 'GameGenre' && item.Type != 'MusicGenre' && item.LocationType != 'Virtual') {
playButtonContainer.show();
queueButtonContainer.show();
}
@ -457,7 +457,11 @@
html += '<label for="selectCommand">Select command</label>';
html += '<select id="selectCommand" data-mini="true">';
html += '<option value="Play" selected>Play</label>';
if (item.LocationType == 'Virtual') {
html += '<option value="Play" selected>Browse</label>';
} else {
html += '<option value="Play" selected>Play</label>';
}
if (item.Chapters && item.Chapters.length) {
html += '<option value="PlayFromChapter">Play from scene</label>';

View file

@ -8,7 +8,8 @@
Limit: 24,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
UserId: Dashboard.getCurrentUserId()
UserId: Dashboard.getCurrentUserId(),
ExcludeLocationTypes: "Virtual"
};
ApiClient.getNextUpEpisodes(options).done(function (result) {

View file

@ -12,7 +12,8 @@
Limit: 8,
Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
Filters: "IsUnplayed"
Filters: "IsUnplayed",
ExcludeLocationTypes: "Virtual"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {