New: Enable Ratings for Albums

pull/288/head
Qstick 7 years ago
parent 8bd9119954
commit c833a6dc84

@ -140,6 +140,7 @@ class AlbumDetails extends Component {
statistics, statistics,
monitored, monitored,
releaseDate, releaseDate,
ratings,
images, images,
media, media,
isFetching, isFetching,
@ -280,14 +281,14 @@ class AlbumDetails extends Component {
</div> </div>
</div> </div>
{/* <div className={styles.details}> <div className={styles.details}>
<div> <div>
<HeartRating <HeartRating
rating={ratings.value} rating={ratings.value}
iconSize={20} iconSize={20}
/> />
</div> </div>
</div> */} </div>
<div className={styles.detailsLabels}> <div className={styles.detailsLabels}>
@ -446,6 +447,7 @@ AlbumDetails.propTypes = {
albumType: PropTypes.string.isRequired, albumType: PropTypes.string.isRequired,
statistics: PropTypes.object.isRequired, statistics: PropTypes.object.isRequired,
releaseDate: PropTypes.string.isRequired, releaseDate: PropTypes.string.isRequired,
ratings: PropTypes.object.isRequired,
images: PropTypes.arrayOf(PropTypes.object).isRequired, images: PropTypes.arrayOf(PropTypes.object).isRequired,
media: PropTypes.arrayOf(PropTypes.object).isRequired, media: PropTypes.arrayOf(PropTypes.object).isRequired,
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,

@ -27,6 +27,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook.Resource
public List<MediumResource> Media { get; set; } public List<MediumResource> Media { get; set; }
public List<TrackResource> Tracks { get; set; } public List<TrackResource> Tracks { get; set; }
public List<ReleaseResource> Releases { get; set; } public List<ReleaseResource> Releases { get; set; }
public RatingResource Rating { get; set; }
public string SelectedRelease { get; set; } public string SelectedRelease { get; set; }
public AlbumArtistResource Artist { get; set; } public AlbumArtistResource Artist { get; set; }
} }

@ -265,6 +265,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
album.ForeignAlbumId = resource.Id; album.ForeignAlbumId = resource.Id;
album.ReleaseDate = resource.ReleaseDate; album.ReleaseDate = resource.ReleaseDate;
album.CleanTitle = Parser.Parser.CleanArtistName(album.Title); album.CleanTitle = Parser.Parser.CleanArtistName(album.Title);
album.Ratings = MapRatings(resource.Rating);
album.AlbumType = resource.Type; album.AlbumType = resource.Type;
if (resource.Images != null) if (resource.Images != null)

@ -14,6 +14,7 @@ namespace NzbDrone.Core.Music
Media = new List<Medium>(); Media = new List<Medium>();
Releases = new List<AlbumRelease>(); Releases = new List<AlbumRelease>();
CurrentRelease = new AlbumRelease(); CurrentRelease = new AlbumRelease();
Ratings = new Ratings();
} }
public const string RELEASE_DATE_FORMAT = "yyyy-MM-dd"; public const string RELEASE_DATE_FORMAT = "yyyy-MM-dd";

@ -101,6 +101,7 @@ namespace NzbDrone.Core.Music
album.ReleaseDate = albumInfo.ReleaseDate; album.ReleaseDate = albumInfo.ReleaseDate;
album.Duration = tuple.Item2.Sum(track => track.Duration); album.Duration = tuple.Item2.Sum(track => track.Duration);
album.Releases = albumInfo.Releases; album.Releases = albumInfo.Releases;
album.Ratings = albumInfo.Ratings;
album.CurrentRelease = albumInfo.CurrentRelease; album.CurrentRelease = albumInfo.CurrentRelease;
_refreshTrackService.RefreshTrackInfo(album, tuple.Item2); _refreshTrackService.RefreshTrackInfo(album, tuple.Item2);

Loading…
Cancel
Save