Skip to content

Commit b0debb0

Browse files
committed
fix
1 parent 4e84d85 commit b0debb0

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

AppInit.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public static AppInit conf
4949

5050
public bool tracks = false;
5151

52-
public string tsuri = "http://127.0.0.1:8090";
52+
public int tracksdelay = 5000;
53+
54+
public string[] tsuri = new string[] { "http://127.0.0.1:8090" };
5355

5456
public bool log = false;
5557

Engine/CORE/StringConvert.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ public static string SearchName(string val)
7373
if (string.IsNullOrWhiteSpace(val))
7474
return null;
7575

76-
return Regex.Replace(val.ToLower(), "[^a-zA-Zа-яА-Я0-9Ёё]+", "").Replace("ё", "е").Replace("щ", "ш");
76+
val = Regex.Replace(val.ToLower(), "[^a-zA-Zа-яА-Я0-9Ёё]+", "").Replace("ё", "е").Replace("щ", "ш");
77+
if (string.IsNullOrWhiteSpace(val))
78+
return null;
79+
80+
return val;
7781
}
7882
#endregion
7983
}

Engine/FileDB/FileDB.cs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

Engine/Tracks/TracksCron.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ async public static Task Run(int typetask)
102102
if (TracksDB.Get(t.Value.magnet) == null)
103103
{
104104
_ = TracksDB.Add(t.Value.magnet);
105-
await Task.Delay(2000);
105+
await Task.Delay(AppInit.conf.tracksdelay);
106106
}
107107
}
108108
catch { }

Engine/Tracks/TracksDB.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static bool theBad(string[] types)
3636
if (types == null || types.Length == 0)
3737
return true;
3838

39-
if (types.Contains("sport") || types.Contains("anime") || types.Contains("tvshow") || types.Contains("docuserial"))
39+
if (types.Contains("sport") || types.Contains("tvshow") || types.Contains("docuserial"))
4040
return true;
4141

4242
return false;
@@ -73,9 +73,15 @@ async public static Task Add(string magnet, string[] types = null)
7373
if (types != null && theBad(types))
7474
return;
7575

76-
ffprobemodel res = null;
76+
if (AppInit.conf.tsuri == null || AppInit.conf.tsuri.Length == 0)
77+
return;
78+
7779
string infohash = MagnetLink.Parse(magnet).InfoHash.ToHex();
78-
string tsuri = $"{AppInit.conf.tsuri}:10{random.Next(10, 90)}";
80+
if (string.IsNullOrEmpty(infohash))
81+
return;
82+
83+
ffprobemodel res = null;
84+
string tsuri = AppInit.conf.tsuri[random.Next(0, AppInit.conf.tsuri.Length)];
7985

8086
#region ffprobe
8187
try

Models/Tracks/ffTags.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ public class ffTags
44
{
55
public string language { get; set; }
66

7+
public string BPS { get; set; }
8+
79
public string DURATION { get; set; }
810

911
public string title { get; set; }

0 commit comments

Comments
 (0)