Make it more complete

This commit is contained in:
2026-04-28 03:21:01 -05:00
parent 74c6d1126e
commit 1052b94a54
34 changed files with 712 additions and 82 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ namespace Tesses.YouTubeDownloader2025Companion
Tytdurl = HttpUtility.HtmlAttributeEncode($"{tytdEndpoint.TrimEnd('/')}/watch?v={HttpUtility.UrlEncode(video.VideoId)}"),
Dlbtn = downloaded ? $"<a class=\"button\" href=\"/api/v1/song?albumId={HttpUtility.UrlEncode(album.AlbumId)}&songId={HttpUtility.UrlEncode(song.SongId)}\"><i>download</i> Download</a>" : string.IsNullOrEmpty(video.VideoId) ? "<span><i>file_download_off</i> Unavailable</span>" : "<span><i>downloading</i> Downloading</span>",
Hasvideo = !string.IsNullOrEmpty(video.VideoId)
}),Program.DefaultLinks());
}),Program.DefaultLinks(2));
}
}
}
+38
View File
@@ -0,0 +1,38 @@
using Tesses.WebServer;
using Scriban;
using System.Web;
using System.Text;
namespace Tesses.YouTubeDownloader2025Companion
{
public static partial class Pages {
private static ReloadingScript mysong_albums = new ReloadingScript("wwwroot/pages/music/mysongs/song-albums.sbnhtml");
public static string MySongAlbums(List<MediaEntry> entries, Song song, List<Artist> artists)
{
StringBuilder builder=new StringBuilder();
if(artists.Count > 0)
builder.Append($"{artists[0].ArtistName} - ");
builder.Append(song.SongName);
if(artists.Count > 1)
builder.Append($" feat. {string.Join(",",artists.Skip(1).Select(e=>e.ArtistName))}");
return Components.Shell($"{builder}'s Albums", mysong_albums.Render(new
{
Songname = builder.ToString(),
Albums = entries.Select(e =>
{
return new
{
Albumurl = $"/music/myalbum?id={HttpUtility.UrlEncode(e.AlbumId)}",
Albumname = HttpUtility.HtmlEncode(e.AlbumName),
Url = $"/music/mysong?albumId={HttpUtility.UrlEncode(e.AlbumId)}&songId={song.SongId}",
Imgurl = $"/api/v1/album-thumbnail?id={HttpUtility.UrlEncode(e.AlbumId)}"
};
})
}), Program.DefaultLinks(2));
}
}
}
+1 -1
View File
@@ -22,7 +22,7 @@ namespace Tesses.YouTubeDownloader2025Companion
Prev = HttpUtility.HtmlAttributeEncode($"/music/mysongs?q={HttpUtility.UrlEncode(query)}&page={(page == 1 ? 1 : page - 1)}"),
Current = page,
Next = HttpUtility.HtmlAttributeEncode($"/music/mysongs?q={HttpUtility.UrlEncode(query)}&page={page + 1}")
}),Program.DefaultLinks());
}),Program.DefaultLinks(2));
}
}
}