thoroughly check sponsorblock segments
This commit is contained in:
parent
2baaa4b1ef
commit
3816c29612
13
Program.cs
13
Program.cs
@ -323,7 +323,18 @@ namespace ttrss_co_client
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Tuple<bool, string>(true, "status other than 404");
|
||||
try
|
||||
{
|
||||
var segments = JsonConvert.DeserializeObject<IEnumerable<sponsorblock.Segment>>(await sponsorblockcheck.Content.ReadAsStringAsync());
|
||||
if(segments.Count() > 1)
|
||||
{
|
||||
return new Tuple<bool, string>(true, $"{segments.Count()} segments");
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Tuple<bool, string>(false, $"no segments");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
sponosrblock/Segment.cs
Normal file
16
sponosrblock/Segment.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ttrss_co_client.sponsorblock
|
||||
{
|
||||
public class Segment
|
||||
{
|
||||
public string category { get; set; }
|
||||
public string actionType { get; set; }
|
||||
public double[] segment { get; set; } //start time, end time
|
||||
public string UUID { get; set; }
|
||||
public double videoDuration { get; set; } //yes, this is repeated in each segment
|
||||
public int locked { get; set; }
|
||||
public int votes { get; set; }
|
||||
public string description { get; set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user