Make it more complete
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user