Skip to content

Commit

Permalink
Add UseFilePath option
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyRacer1337 committed May 8, 2021
1 parent 65f0a6f commit 9e85dda
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Jellyfin.Plugin.ThePornDB/Configuration/configPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ <h1>ThePornDB</h1>
<label class="inputeLabel inputLabelUnfocused" for="MetadataAPIToken">Token</label>
<input id="MetadataAPIToken" name="MetadataAPIToken" type="text" is="emby-input" />
</div>
<div class="checkboxContainer checkboxContainer-withDescripton">
<label class="emby-checkbox-label">
<input id="UseFilePath" name="UseFilePath" type="checkbox" is="emby-checkbox" />
<span>Use FilePath for matching</span>
</label>
</div>
<div class="checkboxContainer checkboxContainer-withDescripton">
<label class="emby-checkbox-label">
<input id="UseOSHash" name="UseOSHash" type="checkbox" is="emby-checkbox" />
Expand Down Expand Up @@ -44,6 +50,7 @@ <h1>ThePornDB</h1>
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(ThePornDBConfig.pluginUniqueId).then(function (config) {
$('#MetadataAPIToken').val(config.MetadataAPIToken).change();
$('#UseFilePath').prop('checked', config.UseFilePath);
$('#UseOSHash').prop('checked', config.UseOSHash);
$('#UseCustomTitle').prop('checked', config.UseCustomTitle);
$('#CustomTitle').val(config.CustomTitle).change();
Expand All @@ -55,6 +62,7 @@ <h1>ThePornDB</h1>
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(ThePornDBConfig.pluginUniqueId).then(function (config) {
config.MetadataAPIToken = $('#MetadataAPIToken').val();
config.UseOSHash = $('#UseFilePath').prop('checked');
config.UseOSHash = $('#UseOSHash').prop('checked');
config.UseCustomTitle = $('#UseCustomTitle').prop('checked');
config.CustomTitle = $('#CustomTitle').val();
Expand Down
6 changes: 5 additions & 1 deletion Jellyfin.Plugin.ThePornDB/Providers/Movies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ public async Task<IEnumerable<RemoteSearchResult>> GetSearchResults(MovieInfo se
oshash = string.Empty;
#if __EMBY__
#else
if (!string.IsNullOrEmpty(searchInfo.Path) && Plugin.Instance.Configuration.UseOSHash)
if (!string.IsNullOrEmpty(searchInfo.Path) && Plugin.Instance.Configuration.UseFilePath)
{
searchTitle = searchInfo.Path;
}

if (!string.IsNullOrEmpty(searchInfo.Path) && Plugin.Instance.Configuration.UseOSHash)
{
oshash = OpenSubtitlesHash.ComputeHash(searchInfo.Path);
}
#endif
Expand Down

0 comments on commit 9e85dda

Please sign in to comment.