mirror of
https://github.com/Crunchy-DL/Crunchy-Downloader.git
synced 2026-01-11 20:10:26 +00:00
Add - Added **File Name Whitespace Substitute** option in settings [#284](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/284) Add - Added **download mode toggle (video/audio/subs)** for seasons with the ability to switch between options [#281](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/281) Add - Added **download all** for only (video/audio/subs) for a season [#281](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/281) Chg - Changed to **display a message** when the calendar fails to load due to Cloudflare issues [#283](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/283) Chg - Adjusted **Calendar upcoming filter** for improved accuracy Fix - Fixed **duplicate/wrong Crunchyroll versions** appearing in downloads [#285](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/285) Fix - Fixed issue where **episodes with non-Japanese audio URLs** couldn't be added Fix - Fixed **calendar crash** on Cloudflare failure [#283](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/283) Fix - Fixed **audio-only downloads** [#279](https://github.com/Crunchy-DL/Crunchy-Downloader/issues/279) Fix - Fixed **crash when no featured music** is present Fix - Fixed **"All" button not working** for music in the Add Downloads tab Fix - Fixed that an **empty File Name Whitespace Substitute** removed all whitespaces
216 lines
No EOL
5 KiB
C#
216 lines
No EOL
5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using CRD.Utils.Structs.History;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace CRD.Utils.Structs.Crunchyroll.Music;
|
|
|
|
public class CrunchyMusicVideoList{
|
|
public int Total{ get; set; }
|
|
public List<CrunchyMusicVideo> Data{ get; set; } =[];
|
|
public Meta? Meta{ get; set; }
|
|
}
|
|
|
|
public class CrunchyMusicVideo : IHistorySource{
|
|
[JsonProperty("copyright")]
|
|
public string? Copyright{ get; set; }
|
|
|
|
[JsonProperty("hash")]
|
|
public string? Hash{ get; set; }
|
|
|
|
[JsonProperty("availability")]
|
|
public MusicVideoAvailability? Availability{ get; set; }
|
|
|
|
[JsonProperty("isMature")]
|
|
public bool IsMature{ get; set; }
|
|
|
|
[JsonProperty("maturityRatings")]
|
|
public object? MaturityRatings{ get; set; }
|
|
|
|
[JsonProperty("title")]
|
|
public string? Title{ get; set; }
|
|
|
|
[JsonProperty("artists")]
|
|
public object? Artists{ get; set; }
|
|
|
|
[JsonProperty("displayArtistNameRequired")]
|
|
public bool DisplayArtistNameRequired{ get; set; }
|
|
|
|
[JsonProperty("streams_link")]
|
|
public string? StreamsLink{ get; set; }
|
|
|
|
[JsonProperty("matureBlocked")]
|
|
public bool MatureBlocked{ get; set; }
|
|
|
|
[JsonProperty("originalRelease")]
|
|
public DateTime OriginalRelease{ get; set; }
|
|
|
|
[JsonProperty("sequenceNumber")]
|
|
public int SequenceNumber{ get; set; }
|
|
|
|
[JsonProperty("type")]
|
|
public string? Type{ get; set; }
|
|
|
|
[JsonProperty("animeIds")]
|
|
public List<string>? AnimeIds{ get; set; }
|
|
|
|
[JsonProperty("description")]
|
|
public string? Description{ get; set; }
|
|
|
|
[JsonProperty("durationMs")]
|
|
public int DurationMs{ get; set; }
|
|
|
|
[JsonProperty("licensor")]
|
|
public string? Licensor{ get; set; }
|
|
|
|
[JsonProperty("slug")]
|
|
public string? Slug{ get; set; }
|
|
|
|
[JsonProperty("artist")]
|
|
public required MusicVideoArtist Artist{ get; set; }
|
|
|
|
[JsonProperty("isPremiumOnly")]
|
|
public bool IsPremiumOnly{ get; set; }
|
|
|
|
[JsonProperty("isPublic")]
|
|
public bool IsPublic{ get; set; }
|
|
|
|
[JsonProperty("publishDate")]
|
|
public DateTime PublishDate{ get; set; }
|
|
|
|
[JsonProperty("displayArtistName")]
|
|
public string? DisplayArtistName{ get; set; }
|
|
|
|
[JsonProperty("genres")]
|
|
public object? Genres{ get; set; }
|
|
|
|
[JsonProperty("readyToPublish")]
|
|
public bool ReadyToPublish{ get; set; }
|
|
|
|
[JsonProperty("id")]
|
|
public required string Id{ get; set; }
|
|
|
|
[JsonProperty("createdAt")]
|
|
public DateTime CreatedAt{ get; set; }
|
|
|
|
public MusicImages? Images{ get; set; }
|
|
|
|
[JsonProperty("updatedAt")]
|
|
public DateTime UpdatedAt{ get; set; }
|
|
|
|
[JsonIgnore]
|
|
public EpisodeType EpisodeType{ get; set; } = EpisodeType.MusicVideo;
|
|
|
|
#region Interface
|
|
|
|
public string GetSeriesId(){
|
|
return Artist.Id;
|
|
}
|
|
|
|
public string GetSeriesTitle(){
|
|
return Artist.Name;
|
|
}
|
|
|
|
public string GetSeasonTitle(){
|
|
return EpisodeType == EpisodeType.MusicVideo ? "Music Videos" : "Concerts";
|
|
}
|
|
|
|
public string GetSeasonNum(){
|
|
return EpisodeType == EpisodeType.MusicVideo ? "1" : "2";
|
|
}
|
|
|
|
public string GetSeasonId(){
|
|
return EpisodeType == EpisodeType.MusicVideo ? "MusicVideos" : "Concerts";
|
|
}
|
|
|
|
public string GetEpisodeId(){
|
|
return Id;
|
|
}
|
|
|
|
public string GetEpisodeNumber(){
|
|
return SequenceNumber + "";
|
|
}
|
|
|
|
public string GetEpisodeTitle(){
|
|
return Title ?? "";
|
|
}
|
|
|
|
public string GetEpisodeDescription(){
|
|
return Description ?? "";
|
|
}
|
|
|
|
public bool IsSpecialSeason(){
|
|
return false;
|
|
}
|
|
|
|
public bool IsSpecialEpisode(){
|
|
return false;
|
|
}
|
|
|
|
public List<string> GetAnimeIds(){
|
|
return AnimeIds ?? [];
|
|
}
|
|
|
|
public List<string> GetEpisodeAvailableDubLang(){
|
|
return[];
|
|
}
|
|
|
|
public List<string> GetEpisodeAvailableSoftSubs(){
|
|
return[];
|
|
}
|
|
|
|
public DateTime GetAvailableDate(){
|
|
return PublishDate;
|
|
}
|
|
|
|
public SeriesType GetSeriesType(){
|
|
return SeriesType.Artist;
|
|
}
|
|
|
|
public EpisodeType GetEpisodeType(){
|
|
return EpisodeType;
|
|
}
|
|
|
|
public string GetImageUrl(){
|
|
if (Images != null){
|
|
return Images.Thumbnail.First().Source ?? string.Empty;
|
|
}
|
|
|
|
return string.Empty;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
public class MusicImages{
|
|
[JsonProperty("poster_tall")]
|
|
public List<Image> PosterTall{ get; set; } =[];
|
|
|
|
[JsonProperty("poster_wide")]
|
|
public List<Image> PosterWide{ get; set; } =[];
|
|
|
|
[JsonProperty("promo_image")]
|
|
public List<Image> PromoImage{ get; set; } =[];
|
|
|
|
public List<Image> Thumbnail{ get; set; } =[];
|
|
}
|
|
|
|
public class MusicVideoArtist{
|
|
[JsonProperty("id")]
|
|
public required string Id{ get; set; }
|
|
|
|
[JsonProperty("name")]
|
|
public required string Name{ get; set; }
|
|
|
|
[JsonProperty("slug")]
|
|
public string? Slug{ get; set; }
|
|
}
|
|
|
|
public class MusicVideoAvailability{
|
|
[JsonProperty("endDate")]
|
|
public DateTime EndDate{ get; set; }
|
|
|
|
[JsonProperty("startDate")]
|
|
public DateTime StartDate{ get; set; }
|
|
} |