Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
immisterio committed Jul 29, 2023
1 parent 4e84d85 commit b0debb0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion AppInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public static AppInit conf

public bool tracks = false;

public string tsuri = "http://127.0.0.1:8090";
public int tracksdelay = 5000;

public string[] tsuri = new string[] { "http://127.0.0.1:8090" };

public bool log = false;

Expand Down
6 changes: 5 additions & 1 deletion Engine/CORE/StringConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public static string SearchName(string val)
if (string.IsNullOrWhiteSpace(val))
return null;

return Regex.Replace(val.ToLower(), "[^a-zA-Zа-яА-Я0-9Ёё]+", "").Replace("ё", "е").Replace("щ", "ш");
val = Regex.Replace(val.ToLower(), "[^a-zA-Zа-яА-Я0-9Ёё]+", "").Replace("ё", "е").Replace("щ", "ш");
if (string.IsNullOrWhiteSpace(val))
return null;

return val;
}
#endregion
}
Expand Down
2 changes: 1 addition & 1 deletion Engine/FileDB/FileDB.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Engine/Tracks/TracksCron.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async public static Task Run(int typetask)
if (TracksDB.Get(t.Value.magnet) == null)
{
_ = TracksDB.Add(t.Value.magnet);
await Task.Delay(2000);
await Task.Delay(AppInit.conf.tracksdelay);
}
}
catch { }
Expand Down
12 changes: 9 additions & 3 deletions Engine/Tracks/TracksDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static bool theBad(string[] types)
if (types == null || types.Length == 0)
return true;

if (types.Contains("sport") || types.Contains("anime") || types.Contains("tvshow") || types.Contains("docuserial"))
if (types.Contains("sport") || types.Contains("tvshow") || types.Contains("docuserial"))
return true;

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

ffprobemodel res = null;
if (AppInit.conf.tsuri == null || AppInit.conf.tsuri.Length == 0)
return;

string infohash = MagnetLink.Parse(magnet).InfoHash.ToHex();
string tsuri = $"{AppInit.conf.tsuri}:10{random.Next(10, 90)}";
if (string.IsNullOrEmpty(infohash))
return;

ffprobemodel res = null;
string tsuri = AppInit.conf.tsuri[random.Next(0, AppInit.conf.tsuri.Length)];

#region ffprobe
try
Expand Down
2 changes: 2 additions & 0 deletions Models/Tracks/ffTags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public class ffTags
{
public string language { get; set; }

public string BPS { get; set; }

public string DURATION { get; set; }

public string title { get; set; }
Expand Down

0 comments on commit b0debb0

Please sign in to comment.