mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
#680 - begin resolution feature
This commit is contained in:
parent
9ab4adcd33
commit
807141cbce
3 changed files with 66 additions and 28 deletions
|
@ -57,7 +57,14 @@
|
||||||
<input type="text" id="txtEpisodePattern" name="txtEpisodePattern" required="required" data-mini="true" />
|
<input type="text" id="txtEpisodePattern" name="txtEpisodePattern" required="required" data-mini="true" />
|
||||||
<div class="fieldDescription episodePatternDescription"></div>
|
<div class="fieldDescription episodePatternDescription"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<label for="txtMultiEpisodePattern">Multi-Episode pattern: </label>
|
||||||
|
<input type="text" id="txtMultiEpisodePattern" name="txtMultiEpisodePattern" required="required" data-mini="true" />
|
||||||
|
<div class="fieldDescription multiEpisodePatternDescription"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
<p>Supported Patterns</p>
|
<p>Supported Patterns</p>
|
||||||
|
|
||||||
<table data-role="table" id="movie-table" data-mode="reflow" class="ui-responsive">
|
<table data-role="table" id="movie-table" data-mode="reflow" class="ui-responsive">
|
||||||
|
@ -70,52 +77,62 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Series Name</td>
|
<td>Series name</td>
|
||||||
<td>%sn</td>
|
<td>%sn</td>
|
||||||
<td>Series Name</td>
|
<td>Series Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Series Name</td>
|
<td>Series name</td>
|
||||||
<td>%s.n</td>
|
<td>%s.n</td>
|
||||||
<td>Series.Name</td>
|
<td>Series.Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Series Name</td>
|
<td>Series name</td>
|
||||||
<td>%s_n</td>
|
<td>%s_n</td>
|
||||||
<td>Series_Name</td>
|
<td>Series_Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Season Number</td>
|
<td>Season number</td>
|
||||||
<td>%s</td>
|
<td>%s</td>
|
||||||
<td>1</td>
|
<td>1</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Season Number</td>
|
<td>Season number</td>
|
||||||
<td>%0s</td>
|
<td>%0s</td>
|
||||||
<td>01</td>
|
<td>01</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Episode Number</td>
|
<td>Episode number</td>
|
||||||
<td>%e</td>
|
<td>%e</td>
|
||||||
<td>4</td>
|
<td>4</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Episode Number</td>
|
<td>Episode number</td>
|
||||||
<td>%0e</td>
|
<td>%0e</td>
|
||||||
<td>04</td>
|
<td>04</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Episode Name</td>
|
<td>Ending episode number</td>
|
||||||
|
<td>%ed</td>
|
||||||
|
<td>5</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Ending episode number</td>
|
||||||
|
<td>%0ed</td>
|
||||||
|
<td>05</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Episode name</td>
|
||||||
<td>%en</td>
|
<td>%en</td>
|
||||||
<td>Episode Name</td>
|
<td>Episode Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Episode Name</td>
|
<td>Episode name</td>
|
||||||
<td>%e.n</td>
|
<td>%e.n</td>
|
||||||
<td>Episode.Name</td>
|
<td>Episode.Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Episode Name</td>
|
<td>Episode name</td>
|
||||||
<td>%e_n</td>
|
<td>%e_n</td>
|
||||||
<td>Episode_Name</td>
|
<td>Episode_Name</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -134,11 +151,6 @@
|
||||||
<input type="checkbox" id="chkDeleteEmptyFolders" name="chkDeleteEmptyFolders" />
|
<input type="checkbox" id="chkDeleteEmptyFolders" name="chkDeleteEmptyFolders" />
|
||||||
<label for="chkDeleteEmptyFolders">Delete empty folders after organizing</label>
|
<label for="chkDeleteEmptyFolders">Delete empty folders after organizing</label>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<input type="checkbox" id="chkEnableTrialMode" name="chkEnableTrialMode" />
|
|
||||||
<label for="chkEnableTrialMode">Enable trial mode</label>
|
|
||||||
<div class="fieldDescription">With trial mode enabled, file organizations will be logged but not executed.</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul data-role="listview" class="ulForm">
|
<ul data-role="listview" class="ulForm">
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
$('.seasonFolderFieldDescription', page).html(replacementHtmlResult);
|
$('.seasonFolderFieldDescription', page).html(replacementHtmlResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateEpisodePatternHelp(page, value) {
|
function getEpisodeFileName(value, enableMultiEpisode) {
|
||||||
|
|
||||||
var seriesName = "Series Name";
|
var seriesName = "Series Name";
|
||||||
var episodeTitle = "Episode Four";
|
var episodeTitle = "Episode Four";
|
||||||
|
|
||||||
value = value.replace('%sn', seriesName)
|
var result = value.replace('%sn', seriesName)
|
||||||
.replace('%s.n', seriesName.replace(' ', '.'))
|
.replace('%s.n', seriesName.replace(' ', '.'))
|
||||||
.replace('%s_n', seriesName.replace(' ', '_'))
|
.replace('%s_n', seriesName.replace(' ', '_'))
|
||||||
.replace('%s', '1')
|
.replace('%s', '1')
|
||||||
|
@ -21,16 +21,39 @@
|
||||||
.replace('%ext', 'mkv')
|
.replace('%ext', 'mkv')
|
||||||
.replace('%en', episodeTitle)
|
.replace('%en', episodeTitle)
|
||||||
.replace('%e.n', episodeTitle.replace(' ', '.'))
|
.replace('%e.n', episodeTitle.replace(' ', '.'))
|
||||||
.replace('%e_n', episodeTitle.replace(' ', '_'))
|
.replace('%e_n', episodeTitle.replace(' ', '_'));
|
||||||
|
|
||||||
|
if (enableMultiEpisode) {
|
||||||
|
result = result
|
||||||
|
.replace('%ed', '5')
|
||||||
|
.replace('%0ed', '05')
|
||||||
|
.replace('%00ed', '005');
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
.replace('%e', '4')
|
.replace('%e', '4')
|
||||||
.replace('%0e', '04')
|
.replace('%0e', '04')
|
||||||
.replace('%00e', '004');
|
.replace('%00e', '004');
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateEpisodePatternHelp(page, value) {
|
||||||
|
|
||||||
|
value = getEpisodeFileName(value, false);
|
||||||
|
|
||||||
var replacementHtmlResult = 'Result: ' + value;
|
var replacementHtmlResult = 'Result: ' + value;
|
||||||
|
|
||||||
$('.episodePatternDescription', page).html(replacementHtmlResult);
|
$('.episodePatternDescription', page).html(replacementHtmlResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateMultiEpisodePatternHelp(page, value) {
|
||||||
|
|
||||||
|
value = getEpisodeFileName(value, true);
|
||||||
|
|
||||||
|
var replacementHtmlResult = 'Result: ' + value;
|
||||||
|
|
||||||
|
$('.multiEpisodePatternDescription', page).html(replacementHtmlResult);
|
||||||
|
}
|
||||||
|
|
||||||
function loadPage(page, config) {
|
function loadPage(page, config) {
|
||||||
|
|
||||||
var tvOptions = config.TvFileOrganizationOptions;
|
var tvOptions = config.TvFileOrganizationOptions;
|
||||||
|
@ -38,7 +61,6 @@
|
||||||
$('#chkEnableTvSorting', page).checked(tvOptions.IsEnabled).checkboxradio('refresh');
|
$('#chkEnableTvSorting', page).checked(tvOptions.IsEnabled).checkboxradio('refresh');
|
||||||
$('#chkOverwriteExistingEpisodes', page).checked(tvOptions.OverwriteExistingEpisodes).checkboxradio('refresh');
|
$('#chkOverwriteExistingEpisodes', page).checked(tvOptions.OverwriteExistingEpisodes).checkboxradio('refresh');
|
||||||
$('#chkDeleteEmptyFolders', page).checked(tvOptions.DeleteEmptyFolders).checkboxradio('refresh');
|
$('#chkDeleteEmptyFolders', page).checked(tvOptions.DeleteEmptyFolders).checkboxradio('refresh');
|
||||||
$('#chkEnableTrialMode', page).checked(tvOptions.EnableTrialMode).checkboxradio('refresh');
|
|
||||||
|
|
||||||
$('#txtMinFileSize', page).val(tvOptions.MinFileSizeMb);
|
$('#txtMinFileSize', page).val(tvOptions.MinFileSizeMb);
|
||||||
$('#txtSeasonFolderPattern', page).val(tvOptions.SeasonFolderPattern).trigger('change');
|
$('#txtSeasonFolderPattern', page).val(tvOptions.SeasonFolderPattern).trigger('change');
|
||||||
|
@ -46,6 +68,7 @@
|
||||||
$('#txtWatchFolder', page).val(tvOptions.WatchLocations[0] || '');
|
$('#txtWatchFolder', page).val(tvOptions.WatchLocations[0] || '');
|
||||||
|
|
||||||
$('#txtEpisodePattern', page).val(tvOptions.EpisodeNamePattern).trigger('change');
|
$('#txtEpisodePattern', page).val(tvOptions.EpisodeNamePattern).trigger('change');
|
||||||
|
$('#txtMultiEpisodePattern', page).val(tvOptions.MultiEpisodeNamePattern).trigger('change');
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#libraryFileOrganizerPage", function () {
|
$(document).on('pageinit', "#libraryFileOrganizerPage", function () {
|
||||||
|
@ -64,6 +87,12 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#txtMultiEpisodePattern', page).on('change keyup', function () {
|
||||||
|
|
||||||
|
updateMultiEpisodePatternHelp(page, this.value);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
$('#btnSelectWatchFolder', page).on("click.selectDirectory", function () {
|
$('#btnSelectWatchFolder', page).on("click.selectDirectory", function () {
|
||||||
|
|
||||||
var picker = new DirectoryBrowser(page);
|
var picker = new DirectoryBrowser(page);
|
||||||
|
@ -106,13 +135,13 @@
|
||||||
tvOptions.IsEnabled = $('#chkEnableTvSorting', form).checked();
|
tvOptions.IsEnabled = $('#chkEnableTvSorting', form).checked();
|
||||||
tvOptions.OverwriteExistingEpisodes = $('#chkOverwriteExistingEpisodes', form).checked();
|
tvOptions.OverwriteExistingEpisodes = $('#chkOverwriteExistingEpisodes', form).checked();
|
||||||
tvOptions.DeleteEmptyFolders = $('#chkDeleteEmptyFolders', form).checked();
|
tvOptions.DeleteEmptyFolders = $('#chkDeleteEmptyFolders', form).checked();
|
||||||
tvOptions.EnableTrialMode = $('#chkEnableTrialMode', form).checked();
|
|
||||||
|
|
||||||
tvOptions.MinFileSizeMb = $('#txtMinFileSize', form).val();
|
tvOptions.MinFileSizeMb = $('#txtMinFileSize', form).val();
|
||||||
tvOptions.SeasonFolderPattern = $('#txtSeasonFolderPattern', form).val();
|
tvOptions.SeasonFolderPattern = $('#txtSeasonFolderPattern', form).val();
|
||||||
tvOptions.SeasonZeroFolderName = $('#txtSeasonZeroName', form).val();
|
tvOptions.SeasonZeroFolderName = $('#txtSeasonZeroName', form).val();
|
||||||
|
|
||||||
tvOptions.EpisodeNamePattern = $('#txtEpisodePattern', form).val();
|
tvOptions.EpisodeNamePattern = $('#txtEpisodePattern', form).val();
|
||||||
|
tvOptions.MultiEpisodeNamePattern = $('#txtMultiEpisodePattern', form).val();
|
||||||
|
|
||||||
var watchLocation = $('#txtWatchFolder', form).val();
|
var watchLocation = $('#txtWatchFolder', form).val();
|
||||||
tvOptions.WatchLocations = watchLocation ? [watchLocation] : [];
|
tvOptions.WatchLocations = watchLocation ? [watchLocation] : [];
|
||||||
|
|
|
@ -99,10 +99,7 @@
|
||||||
|
|
||||||
var color = null;
|
var color = null;
|
||||||
|
|
||||||
if (status == 'SkippedTrial') {
|
if (status == 'SkippedExisting') {
|
||||||
status = 'Trial';
|
|
||||||
}
|
|
||||||
else if (status == 'SkippedExisting') {
|
|
||||||
status = 'Skipped';
|
status = 'Skipped';
|
||||||
}
|
}
|
||||||
else if (status == 'Failure') {
|
else if (status == 'Failure') {
|
||||||
|
@ -158,7 +155,7 @@
|
||||||
html += '<td class="organizerButtonCell">';
|
html += '<td class="organizerButtonCell">';
|
||||||
|
|
||||||
|
|
||||||
if (item.Status == 'SkippedTrial' || item.Status == 'SkippedExisting') {
|
if (item.Status == 'SkippedExisting') {
|
||||||
html += '<button data-resultid="' + item.Id + '" type="button" data-inline="true" data-icon="action" data-mini="true" data-iconpos="notext" class="btnProcessResult organizerButton" title="Organize File">Process</button>';
|
html += '<button data-resultid="' + item.Id + '" type="button" data-inline="true" data-icon="action" data-mini="true" data-iconpos="notext" class="btnProcessResult organizerButton" title="Organize File">Process</button>';
|
||||||
} else {
|
} else {
|
||||||
html += '<button style="visibility:hidden;" type="button" data-inline="true" data-icon="info" data-mini="true" data-iconpos="notext" class="organizerButton"></button>';
|
html += '<button style="visibility:hidden;" type="button" data-inline="true" data-icon="info" data-mini="true" data-iconpos="notext" class="organizerButton"></button>';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue