Skip to content

Commit

Permalink
Organize Movies #3
Browse files Browse the repository at this point in the history
  • Loading branch information
softworkz committed Dec 13, 2015
1 parent bda9b66 commit c5325de
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 49 deletions.
4 changes: 2 additions & 2 deletions MediaBrowser.Model/FileOrganization/FileOrganizationResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ public class FileOrganizationResult
/// <value>The size of the file.</value>
public long FileSize { get; set; }

public string ExtractedVideoName { get; set; }
public string ExtractedMovieName { get; set; }

/// <summary>
/// Gets or sets the extracted video year.
/// </summary>
/// <value>The extracted video year.</value>
public int? ExtractedVideoYear { get; set; }
public int? ExtractedMovieYear { get; set; }

public FileOrganizationResult()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public async Task<FileOrganizationResult> OrganizeEpisodeFile(string path, AutoO
var videoInfo = videoResolver.Resolve(path, false);
if (videoInfo != null)
{
result.ExtractedVideoName = videoInfo.Name;
result.ExtractedVideoYear = videoInfo.Year;
result.ExtractedMovieName = videoInfo.Name;
result.ExtractedMovieYear = videoInfo.Year;
}

var resolver = new Naming.TV.EpisodeResolver(namingOptions, new PatternsLogger());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public async Task SaveResult(FileOrganizationResult result, CancellationToken ca
_saveResultCommand.GetParameter(index++).Value = result.ExtractedEpisodeNumber;
_saveResultCommand.GetParameter(index++).Value = result.ExtractedEndingEpisodeNumber;
_saveResultCommand.GetParameter(index++).Value = string.Join("|", result.DuplicatePaths.ToArray());
_saveResultCommand.GetParameter(index++).Value = result.ExtractedVideoName;
_saveResultCommand.GetParameter(index).Value = result.ExtractedVideoYear;
_saveResultCommand.GetParameter(index++).Value = result.ExtractedMovieName;
_saveResultCommand.GetParameter(index).Value = result.ExtractedMovieYear;

_saveResultCommand.Transaction = transaction;

Expand Down Expand Up @@ -434,13 +434,13 @@ public FileOrganizationResult GetResult(IDataReader reader)
index++;
if (!reader.IsDBNull(index))
{
result.ExtractedVideoName = reader.GetString(index);
result.ExtractedMovieName = reader.GetString(index);
}

index++;
if (!reader.IsDBNull(index))
{
result.ExtractedVideoYear = reader.GetInt32(index);
result.ExtractedMovieYear = reader.GetInt32(index);
}

return result;
Expand Down
82 changes: 62 additions & 20 deletions MediaBrowser.WebDashboard/dashboard-ui/autoorganizelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="ui-bar-a" style="text-align: center; padding: 0 20px;">
<h3>Organize Manually</h3>
</div>
<div data-role="controlgroup" data-type="horizontal" class="" data-mini="true" style="margin-left: 14px">
<div data-role="controlgroup" data-type="horizontal" class="" data-mini="true" style="margin-left: 10px; margin-bottom: 0; margin-top: 10px">
<a href="#" data-role="button" id="popupTab1" class="ui-btn ui-btn-active popup-tab">TV Episode</a>
<a href="#" data-role="button" id="popupTab2" class="ui-btn popup-tab">Movie</a>
</div>
Expand All @@ -69,6 +69,9 @@ <h3>Organize Manually</h3>
<div style="margin: 1em 0 1em; min-width: 350px;">
<label for="selectSeries">${LabelSeries}</label>
<select id="selectSeries" data-mini="true" required="required"></select>
<button type="button" id="btnNewSeries" data-icon="add" data-mini="true">
New Series
</button>
</div>
<div style="margin: 1em 0;">
<label for="txtSeason">${LabelSeasonNumber}</label>
Expand All @@ -83,10 +86,10 @@ <h3>Organize Manually</h3>
<input id="txtEndingEpisode" type="number" pattern="[0-9]*" min="0" />
<div class="fieldDescription">${LabelEndingEpisodeNumberHelp}</div>
</div>
<div style="margin: 1em 0;">
<div id="divRememberCorrection" style="margin: 1em 0;">
<label>${TabSmartMatch}</label>
<input type="checkbox" id="chkRememberCorrection" name="chkRememberCorrection" data-mini="true" />
<label for="chkRememberCorrection">${LabelOrganizeSmartMatchOption} '<span class="extractedName" />' </label>
<label for="chkRememberCorrection" style="max-width: 350px">${LabelOrganizeSmartMatchOption} '<span class="extractedName" />' </label>
</div>
<p>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
Expand All @@ -98,50 +101,89 @@ <h3>Organize Manually</h3>
</p>
<input id="hfResultId" type="hidden" />
</form>
</div>
<div class="popupTabPage hide" data-role="content">
<form class="organizeMovieForm">

<form class="createSeriesForm">
<p><span class="inputFile"></span></p>
<div style="margin: 1em 0 1em; min-width: 350px;">
<label for="txtVideoName">Movie</label>
<input id="txtVideoName" required="required" min="0" />
<label for="txtNewSeriesName">${LabelSeries}</label>
<input id="txtNewSeriesName" required="required" />
</div>
<div style="margin: 1em 0;">
<label for="txtVideoYear">Year</label>
<input id="txtVideoYear" type="number" pattern="[0-9]*" min="0" />
<label for="txtNewSeriesYear">${LabelYear}</label>
<input id="txtNewSeriesYear" type="number" pattern="[0-9]*" min="0" />
</div>
<div style="margin: 1em 0;">
<button type="button" data-icon="info" id="btnIdentify" data-mini="true">
<button type="button" data-icon="info" id="btnIdentifySeries" data-mini="true">
${ButtonIdentify}
</button>
</div>
<div style="margin: 1em 0 1em;">
<label for="txtSelectedVideo">Selected Movie</label>
<input id="txtSelectedVideo" required="required" min="0" />
<label for="txtSelectedNewSeries">Selected Series</label>
<input id="txtSelectedNewSeries" class="txt-readonly" required="required" />
</div>
<div style="margin: 1em 0 1em; min-width: 350px;">
<label for="selectSeriesFolder">Destination Folder</label>
<select id="selectSeriesFolder" data-mini="true" required="required"></select>
</div>
<p>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
${ButtonOk}
Create Series
</button>
<button type="button" data-icon="delete" onclick="$(this).parents('.popup').popup('close');" data-mini="true">
<button type="button" id="btnCancelNewSeries" data-icon="delete" data-mini="true">
${ButtonCancel}
</button>
</p>
<input id="hfResultId" type="hidden" />
</form>

<form class="identificationResultForm">

<div class="identificationSearchResults" style="height:auto">
<div class="identificationSearchResultList"></div>
</div>
<div class="popupTabPage hide" data-role="content">
<form class="organizeMovieForm">
<p><span class="inputFile"></span></p>
<div style="margin: 1em 0 1em; min-width: 350px;">
<label for="txtMovieName">Movie</label>
<input id="txtMovieName" required="required" min="0" />
</div>
<div style="margin: 1em 0;">
<label for="txtMovieYear">Year</label>
<input id="txtMovieYear" type="number" pattern="[0-9]*" min="0" />
</div>
<div style="margin: 1em 0;">
<button type="button" data-icon="info" id="btnIdentifyMovie" data-mini="true">
${ButtonIdentify}
</button>
</div>
<div style="margin: 1em 0 1em;">
<label for="txtSelectedMovie">Selected Movie</label>
<input id="txtSelectedMovie" class="txt-readonly" required="required" />
</div>
<div style="margin: 1em 0 1em; min-width: 350px;">
<label for="selectMovieFolder">Destination Folder</label>
<select id="selectMovieFolder" data-mini="true" required="required"></select>
</div>
<p>
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
${ButtonOk}
</button>
<button type="button" data-icon="delete" onclick="$(this).parents('.popup').popup('close');" data-mini="true">
${ButtonCancel}
</button>
</p>
<input id="hfResultId" type="hidden" />
</form>
</div>

<form class="identificationResultForm">

<div class="identificationSearchResults" style="height:auto">
<div class="identificationSearchResultList"></div>
</div>
<p>
<button type="button" data-icon="delete" id="btnCancelIdentify" data-mini="true">
${ButtonCancel}
</button>
</p>
</form>

</div>
</div>
</body>
Expand Down
Loading

0 comments on commit c5325de

Please sign in to comment.