1
0
Fork 0
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:
Luke Pulverenti 2014-01-21 11:24:12 -05:00
parent 9ab4adcd33
commit 807141cbce
3 changed files with 66 additions and 28 deletions

View file

@ -57,7 +57,14 @@
<input type="text" id="txtEpisodePattern" name="txtEpisodePattern" required="required" data-mini="true" />
<div class="fieldDescription episodePatternDescription"></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>
<table data-role="table" id="movie-table" data-mode="reflow" class="ui-responsive">
@ -70,52 +77,62 @@
</thead>
<tbody>
<tr>
<td>Series Name</td>
<td>Series name</td>
<td>%sn</td>
<td>Series Name</td>
</tr>
<tr>
<td>Series Name</td>
<td>Series name</td>
<td>%s.n</td>
<td>Series.Name</td>
</tr>
<tr>
<td>Series Name</td>
<td>Series name</td>
<td>%s_n</td>
<td>Series_Name</td>
</tr>
<tr>
<td>Season Number</td>
<td>Season number</td>
<td>%s</td>
<td>1</td>
</tr>
<tr>
<td>Season Number</td>
<td>Season number</td>
<td>%0s</td>
<td>01</td>
</tr>
<tr>
<td>Episode Number</td>
<td>Episode number</td>
<td>%e</td>
<td>4</td>
</tr>
<tr>
<td>Episode Number</td>
<td>Episode number</td>
<td>%0e</td>
<td>04</td>
</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>Episode Name</td>
</tr>
<tr>
<td>Episode Name</td>
<td>Episode name</td>
<td>%e.n</td>
<td>Episode.Name</td>
</tr>
<tr>
<td>Episode Name</td>
<td>Episode name</td>
<td>%e_n</td>
<td>Episode_Name</td>
</tr>
@ -134,11 +151,6 @@
<input type="checkbox" id="chkDeleteEmptyFolders" name="chkDeleteEmptyFolders" />
<label for="chkDeleteEmptyFolders">Delete empty folders after organizing</label>
</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 data-role="listview" class="ulForm">

View file

@ -7,12 +7,12 @@
$('.seasonFolderFieldDescription', page).html(replacementHtmlResult);
}
function updateEpisodePatternHelp(page, value) {
function getEpisodeFileName(value, enableMultiEpisode) {
var seriesName = "Series Name";
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', '1')
@ -21,16 +21,39 @@
.replace('%ext', 'mkv')
.replace('%en', episodeTitle)
.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('%0e', '04')
.replace('%00e', '004');
}
function updateEpisodePatternHelp(page, value) {
value = getEpisodeFileName(value, false);
var replacementHtmlResult = 'Result: ' + value;
$('.episodePatternDescription', page).html(replacementHtmlResult);
}
function updateMultiEpisodePatternHelp(page, value) {
value = getEpisodeFileName(value, true);
var replacementHtmlResult = 'Result: ' + value;
$('.multiEpisodePatternDescription', page).html(replacementHtmlResult);
}
function loadPage(page, config) {
var tvOptions = config.TvFileOrganizationOptions;
@ -38,7 +61,6 @@
$('#chkEnableTvSorting', page).checked(tvOptions.IsEnabled).checkboxradio('refresh');
$('#chkOverwriteExistingEpisodes', page).checked(tvOptions.OverwriteExistingEpisodes).checkboxradio('refresh');
$('#chkDeleteEmptyFolders', page).checked(tvOptions.DeleteEmptyFolders).checkboxradio('refresh');
$('#chkEnableTrialMode', page).checked(tvOptions.EnableTrialMode).checkboxradio('refresh');
$('#txtMinFileSize', page).val(tvOptions.MinFileSizeMb);
$('#txtSeasonFolderPattern', page).val(tvOptions.SeasonFolderPattern).trigger('change');
@ -46,6 +68,7 @@
$('#txtWatchFolder', page).val(tvOptions.WatchLocations[0] || '');
$('#txtEpisodePattern', page).val(tvOptions.EpisodeNamePattern).trigger('change');
$('#txtMultiEpisodePattern', page).val(tvOptions.MultiEpisodeNamePattern).trigger('change');
}
$(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 () {
var picker = new DirectoryBrowser(page);
@ -106,13 +135,13 @@
tvOptions.IsEnabled = $('#chkEnableTvSorting', form).checked();
tvOptions.OverwriteExistingEpisodes = $('#chkOverwriteExistingEpisodes', form).checked();
tvOptions.DeleteEmptyFolders = $('#chkDeleteEmptyFolders', form).checked();
tvOptions.EnableTrialMode = $('#chkEnableTrialMode', form).checked();
tvOptions.MinFileSizeMb = $('#txtMinFileSize', form).val();
tvOptions.SeasonFolderPattern = $('#txtSeasonFolderPattern', form).val();
tvOptions.SeasonZeroFolderName = $('#txtSeasonZeroName', form).val();
tvOptions.EpisodeNamePattern = $('#txtEpisodePattern', form).val();
tvOptions.MultiEpisodeNamePattern = $('#txtMultiEpisodePattern', form).val();
var watchLocation = $('#txtWatchFolder', form).val();
tvOptions.WatchLocations = watchLocation ? [watchLocation] : [];

View file

@ -99,10 +99,7 @@
var color = null;
if (status == 'SkippedTrial') {
status = 'Trial';
}
else if (status == 'SkippedExisting') {
if (status == 'SkippedExisting') {
status = 'Skipped';
}
else if (status == 'Failure') {
@ -158,7 +155,7 @@
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>';
} else {
html += '<button style="visibility:hidden;" type="button" data-inline="true" data-icon="info" data-mini="true" data-iconpos="notext" class="organizerButton"></button>';