mirror of
https://github.com/Readarr/Readarr.git
synced 2026-03-05 13:20:32 -05:00
Fixed: Downloaded Albums not reflected on Calendar
Turns albums green if 100% of tracks are in library Fixes #520
This commit is contained in:
@@ -42,10 +42,9 @@ class AgendaEvent extends Component {
|
||||
artist,
|
||||
title,
|
||||
foreignAlbumId,
|
||||
albumType,
|
||||
releaseDate,
|
||||
monitored,
|
||||
// hasFile,
|
||||
statistics,
|
||||
grabbed,
|
||||
queueItem,
|
||||
showDate,
|
||||
@@ -57,7 +56,7 @@ class AgendaEvent extends Component {
|
||||
// const endTime = startTime.add(artist.runtime, 'minutes');
|
||||
const downloading = !!(queueItem || grabbed);
|
||||
const isMonitored = artist.monitored && monitored;
|
||||
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored);
|
||||
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -126,7 +125,7 @@ AgendaEvent.propTypes = {
|
||||
albumType: PropTypes.string.isRequired,
|
||||
releaseDate: PropTypes.string.isRequired,
|
||||
monitored: PropTypes.bool.isRequired,
|
||||
// hasFile: PropTypes.bool.isRequired,
|
||||
statistics: PropTypes.object.isRequired,
|
||||
grabbed: PropTypes.bool,
|
||||
queueItem: PropTypes.object,
|
||||
showDate: PropTypes.bool.isRequired,
|
||||
|
||||
@@ -49,7 +49,7 @@ class CalendarEvent extends Component {
|
||||
foreignAlbumId,
|
||||
releaseDate,
|
||||
monitored,
|
||||
// hasFile,
|
||||
statistics,
|
||||
grabbed,
|
||||
queueItem,
|
||||
// timeFormat,
|
||||
@@ -64,7 +64,7 @@ class CalendarEvent extends Component {
|
||||
// const endTime = startTime.add(artist.runtime, 'minutes');
|
||||
const downloading = !!(queueItem || grabbed);
|
||||
const isMonitored = artist.monitored && monitored;
|
||||
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored);
|
||||
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -121,12 +121,12 @@ CalendarEvent.propTypes = {
|
||||
artist: PropTypes.object.isRequired,
|
||||
title: PropTypes.string.isRequired,
|
||||
foreignAlbumId: PropTypes.string.isRequired,
|
||||
statistics: PropTypes.object.isRequired,
|
||||
// seasonNumber: PropTypes.number.isRequired,
|
||||
// episodeNumber: PropTypes.number.isRequired,
|
||||
// absoluteEpisodeNumber: PropTypes.number,
|
||||
releaseDate: PropTypes.string.isRequired,
|
||||
monitored: PropTypes.bool.isRequired,
|
||||
// hasFile: PropTypes.bool.isRequired,
|
||||
grabbed: PropTypes.bool,
|
||||
queueItem: PropTypes.object,
|
||||
// timeFormat: PropTypes.string.isRequired,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* eslint max-params: 0 */
|
||||
import moment from 'moment';
|
||||
|
||||
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored) {
|
||||
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored, percentOfTracks) {
|
||||
const currentTime = moment();
|
||||
|
||||
// if (hasFile) {
|
||||
// return 'downloaded';
|
||||
// }
|
||||
if (percentOfTracks === 100) {
|
||||
return 'downloaded';
|
||||
}
|
||||
|
||||
if (downloading) {
|
||||
return 'downloading';
|
||||
|
||||
Reference in New Issue
Block a user