mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 12:59:39 -07:00
An attempt to fix #108
This commit is contained in:
parent
cccb71b605
commit
c7826003bc
1 changed files with 4 additions and 4 deletions
|
@ -24,6 +24,7 @@
|
||||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
// ************************************************************************/
|
// ************************************************************************/
|
||||||
#endregion
|
#endregion
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
@ -97,17 +98,16 @@ namespace PlexRequests.Services
|
||||||
{
|
{
|
||||||
throw new ApplicationSettingsException("The settings are not configured for Plex or Authentication");
|
throw new ApplicationSettingsException("The settings are not configured for Plex or Authentication");
|
||||||
}
|
}
|
||||||
|
var results = PlexApi.SearchContent(authSettings.PlexAuthToken, title, plexSettings.FullUri);
|
||||||
if (!string.IsNullOrEmpty(year))
|
if (!string.IsNullOrEmpty(year))
|
||||||
{
|
{
|
||||||
var results = PlexApi.SearchContent(authSettings.PlexAuthToken, title, plexSettings.FullUri);
|
var result = results.Video?.FirstOrDefault(x => x.Title.Equals(title, StringComparison.InvariantCultureIgnoreCase) && x.Year == year);
|
||||||
var result = results.Video?.FirstOrDefault(x => x.Title.Contains(title) && x.Year == year);
|
|
||||||
var directoryTitle = results.Directory?.Title == title && results.Directory?.Year == year;
|
var directoryTitle = results.Directory?.Title == title && results.Directory?.Year == year;
|
||||||
return result?.Title != null || directoryTitle;
|
return result?.Title != null || directoryTitle;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var results = PlexApi.SearchContent(authSettings.PlexAuthToken, title, plexSettings.FullUri);
|
var result = results.Video?.FirstOrDefault(x => x.Title.Equals(title, StringComparison.InvariantCultureIgnoreCase));
|
||||||
var result = results.Video?.FirstOrDefault(x => x.Title.Contains(title));
|
|
||||||
var directoryTitle = results.Directory?.Title == title;
|
var directoryTitle = results.Directory?.Title == title;
|
||||||
return result?.Title != null || directoryTitle;
|
return result?.Title != null || directoryTitle;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue