mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-04 21:35:19 -04:00
Refactorying a bit
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kyoo.Utility;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Kyoo.Utility;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Kyoo.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System.Linq;
|
||||
using Kyoo.Utility;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Kyoo.Controllers;
|
||||
using System;
|
||||
using Kyoo.Controllers;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Kyoo.Utility;
|
||||
|
||||
namespace Kyoo.Models
|
||||
{
|
||||
@@ -127,6 +127,14 @@ namespace Kyoo.Models
|
||||
reader["externalIDs"] as string);
|
||||
}
|
||||
|
||||
public string GetID(string provider)
|
||||
{
|
||||
if (ExternalIDs?.Contains(provider) != true)
|
||||
return null;
|
||||
int startIndex = ExternalIDs.IndexOf(provider, StringComparison.Ordinal) + provider.Length + 1; //The + 1 is for the '='
|
||||
return ExternalIDs.Substring(startIndex, ExternalIDs.IndexOf('|', startIndex) - startIndex);
|
||||
}
|
||||
|
||||
public Show Set(string slug, string path)
|
||||
{
|
||||
Slug = slug;
|
||||
|
||||
Reference in New Issue
Block a user