Refactorying a bit

This commit is contained in:
Zoe Roux
2020-01-21 23:20:18 +01:00
parent c0ab6f898a
commit 899adb2b9d
12 changed files with 76 additions and 83 deletions
-1
View File
@@ -2,7 +2,6 @@
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
using Kyoo.Utility;
namespace Kyoo.Models
{
-1
View File
@@ -1,6 +1,5 @@
using Newtonsoft.Json;
using System;
using Kyoo.Utility;
namespace Kyoo.Models
{
+1 -2
View File
@@ -1,5 +1,4 @@
using Kyoo.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace Kyoo.Models
{
+1 -3
View File
@@ -1,6 +1,4 @@
using System.Linq;
using Kyoo.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json;
namespace Kyoo.Models
{
+10 -2
View File
@@ -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;