Fixed: Downloaded Albums not reflected on Calendar

Turns albums green if 100% of tracks are in library

Fixes #520
pull/529/head
Qstick 6 years ago
parent 1eeb1bbf63
commit f8ce2334c6

@ -42,10 +42,9 @@ class AgendaEvent extends Component {
artist, artist,
title, title,
foreignAlbumId, foreignAlbumId,
albumType,
releaseDate, releaseDate,
monitored, monitored,
// hasFile, statistics,
grabbed, grabbed,
queueItem, queueItem,
showDate, showDate,
@ -57,7 +56,7 @@ class AgendaEvent extends Component {
// const endTime = startTime.add(artist.runtime, 'minutes'); // const endTime = startTime.add(artist.runtime, 'minutes');
const downloading = !!(queueItem || grabbed); const downloading = !!(queueItem || grabbed);
const isMonitored = artist.monitored && monitored; const isMonitored = artist.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored); const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
return ( return (
<div> <div>
@ -126,7 +125,7 @@ AgendaEvent.propTypes = {
albumType: PropTypes.string.isRequired, albumType: PropTypes.string.isRequired,
releaseDate: PropTypes.string.isRequired, releaseDate: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,
// hasFile: PropTypes.bool.isRequired, statistics: PropTypes.object.isRequired,
grabbed: PropTypes.bool, grabbed: PropTypes.bool,
queueItem: PropTypes.object, queueItem: PropTypes.object,
showDate: PropTypes.bool.isRequired, showDate: PropTypes.bool.isRequired,

@ -49,7 +49,7 @@ class CalendarEvent extends Component {
foreignAlbumId, foreignAlbumId,
releaseDate, releaseDate,
monitored, monitored,
// hasFile, statistics,
grabbed, grabbed,
queueItem, queueItem,
// timeFormat, // timeFormat,
@ -64,7 +64,7 @@ class CalendarEvent extends Component {
// const endTime = startTime.add(artist.runtime, 'minutes'); // const endTime = startTime.add(artist.runtime, 'minutes');
const downloading = !!(queueItem || grabbed); const downloading = !!(queueItem || grabbed);
const isMonitored = artist.monitored && monitored; const isMonitored = artist.monitored && monitored;
const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored); const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored, statistics.percentOfTracks);
return ( return (
<div> <div>
@ -121,12 +121,12 @@ CalendarEvent.propTypes = {
artist: PropTypes.object.isRequired, artist: PropTypes.object.isRequired,
title: PropTypes.string.isRequired, title: PropTypes.string.isRequired,
foreignAlbumId: PropTypes.string.isRequired, foreignAlbumId: PropTypes.string.isRequired,
statistics: PropTypes.object.isRequired,
// seasonNumber: PropTypes.number.isRequired, // seasonNumber: PropTypes.number.isRequired,
// episodeNumber: PropTypes.number.isRequired, // episodeNumber: PropTypes.number.isRequired,
// absoluteEpisodeNumber: PropTypes.number, // absoluteEpisodeNumber: PropTypes.number,
releaseDate: PropTypes.string.isRequired, releaseDate: PropTypes.string.isRequired,
monitored: PropTypes.bool.isRequired, monitored: PropTypes.bool.isRequired,
// hasFile: PropTypes.bool.isRequired,
grabbed: PropTypes.bool, grabbed: PropTypes.bool,
queueItem: PropTypes.object, queueItem: PropTypes.object,
// timeFormat: PropTypes.string.isRequired, // timeFormat: PropTypes.string.isRequired,

@ -1,12 +1,12 @@
/* eslint max-params: 0 */ /* eslint max-params: 0 */
import moment from 'moment'; import moment from 'moment';
function getStatusStyle(episodeNumber, downloading, startTime, isMonitored) { function getStatusStyle(episodeNumber, downloading, startTime, isMonitored, percentOfTracks) {
const currentTime = moment(); const currentTime = moment();
// if (hasFile) { if (percentOfTracks === 100) {
// return 'downloaded'; return 'downloaded';
// } }
if (downloading) { if (downloading) {
return 'downloading'; return 'downloading';

Loading…
Cancel
Save