Skip to content

Commit

Permalink
fix timespan parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxocube committed Jan 6, 2025
1 parent 7fc90dc commit 4662774
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Xml;
using Google.Apis.YouTube.v3;
using MassTransit;
using MediaFeeder.Data;
Expand Down Expand Up @@ -74,7 +75,7 @@ public async Task Consume(ConsumeContext<YoutubeActualVideoSynchroniseContract>
video.Rating = (double?)(videoStats.Statistics.LikeCount / (videoStats.Statistics.LikeCount + videoStats.Statistics.DislikeCount)) ?? 0;

video.Views = (int?)videoStats.Statistics.ViewCount ?? 0;
video.DurationSpan = TimeSpan.Parse(videoStats.ContentDetails.Duration);
video.DurationSpan = XmlConvert.ToTimeSpan(videoStats.ContentDetails.Duration);
video.Description = videoStats.Snippet.Description;
}
}
Expand Down

0 comments on commit 4662774

Please sign in to comment.