Skip to content

Commit 577f62c

Browse files
committed
Expose YouTube Video URL as a property, and assign it to the Album
This also fixes #1 as reported by arg274
1 parent 7040d05 commit 577f62c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Albums/YouTube.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System.Collections.Generic;
2020
using System.IO;
2121
using System.Text.Json.Serialization;
22+
using System.Xml.Serialization;
2223
using Gunloader.Programs;
2324
using Gunloader.Serialisation;
2425
using static System.Guid;
@@ -49,7 +50,8 @@ public override void Hydrate(Metadata metadata)
4950
var video = new Video();
5051
video.Load(_url, _ytdl);
5152

52-
Title = video.Title;
53+
Title = video.Title;
54+
Source = video.URL;
5355

5456
for (var i = 0; i < video.Chapters.Count; i++)
5557
{
@@ -93,6 +95,7 @@ public class Video
9395
[JsonPropertyName("id")] public string ID { get; set; } = string.Empty;
9496
[JsonPropertyName("title")] public string Title { get; set; } = string.Empty;
9597
[JsonPropertyName("chapters")] public List<Chapter> Chapters { get; set; } = new();
98+
[JsonIgnore] [XmlIgnore] public string URL => $"https://youtu.be/{ID}";
9699

97100
public void Load(string source, YTDL ytdl)
98101
{

0 commit comments

Comments
 (0)