diff --git a/frontend/src/Activity/History/History.js b/frontend/src/Activity/History/History.js index af2fb4f3f..dddfe3d8a 100644 --- a/frontend/src/Activity/History/History.js +++ b/frontend/src/Activity/History/History.js @@ -30,16 +30,16 @@ class History extends Component { filterKey, filterValue, totalRecords, - isEpisodesFetching, - isEpisodesPopulated, + isAlbumsFetching, + isAlbumsPopulated, episodesError, onFilterSelect, onFirstPagePress, ...otherProps } = this.props; - const isFetchingAny = isFetching || isEpisodesFetching; - const isAllPopulated = isPopulated && (isEpisodesPopulated || !items.length); + const isFetchingAny = isFetching || isAlbumsFetching; + const isAllPopulated = isPopulated && (isAlbumsPopulated || !items.length); const hasError = error || episodesError; return ( @@ -132,7 +132,7 @@ class History extends Component { { // If history isPopulated and it's empty show no history found and don't - // wait for the episodes to populate because they are never coming. + // wait for the albums to populate because they are never coming. isPopulated && !hasError && !items.length &&
@@ -185,8 +185,8 @@ History.propTypes = { filterKey: PropTypes.string, filterValue: PropTypes.string, totalRecords: PropTypes.number, - isEpisodesFetching: PropTypes.bool.isRequired, - isEpisodesPopulated: PropTypes.bool.isRequired, + isAlbumsFetching: PropTypes.bool.isRequired, + isAlbumsPopulated: PropTypes.bool.isRequired, episodesError: PropTypes.object, onFilterSelect: PropTypes.func.isRequired, onFirstPagePress: PropTypes.func.isRequired diff --git a/frontend/src/Activity/History/HistoryConnector.js b/frontend/src/Activity/History/HistoryConnector.js index 9034dab84..e00eaae05 100644 --- a/frontend/src/Activity/History/HistoryConnector.js +++ b/frontend/src/Activity/History/HistoryConnector.js @@ -14,8 +14,8 @@ function createMapStateToProps() { (state) => state.episodes, (history, episodes) => { return { - isEpisodesFetching: episodes.isFetching, - isEpisodesPopulated: episodes.isPopulated, + isAlbumsFetching: episodes.isFetching, + isAlbumsPopulated: episodes.isPopulated, episodesError: episodes.error, ...history }; @@ -40,8 +40,8 @@ class HistoryConnector extends Component { componentDidUpdate(prevProps) { if (hasDifferentItems(prevProps.items, this.props.items)) { - const episodeIds = selectUniqueIds(this.props.items, 'episodeId'); - this.props.fetchEpisodes({ episodeIds }); + const albumIds = selectUniqueIds(this.props.items, 'albumId'); + this.props.fetchEpisodes({ albumIds }); } } diff --git a/frontend/src/Activity/History/HistoryEventTypeCell.js b/frontend/src/Activity/History/HistoryEventTypeCell.js index f013b3f55..21a210107 100644 --- a/frontend/src/Activity/History/HistoryEventTypeCell.js +++ b/frontend/src/Activity/History/HistoryEventTypeCell.js @@ -36,17 +36,17 @@ function getIconKind(eventType) { function getTooltip(eventType, data) { switch (eventType) { case 'grabbed': - return `Episode grabbed from ${data.indexer} and sent to ${data.downloadClient}`; + return `Album grabbed from ${data.indexer} and sent to ${data.downloadClient}`; case 'seriesFolderImported': - return 'Episode imported from series folder'; + return 'Album imported from artist folder'; case 'downloadFolderImported': - return 'Episode downloaded successfully and picked up from download client'; + return 'Album downloaded successfully and picked up from download client'; case 'downloadFailed': - return 'Episode download failed'; + return 'Album download failed'; case 'episodeFileDeleted': - return 'Episode file deleted'; + return 'Track file deleted'; case 'episodeFileRenamed': - return 'Episode file renamed'; + return 'Track file renamed'; default: return 'Unknown event'; } diff --git a/frontend/src/Activity/History/HistoryRow.js b/frontend/src/Activity/History/HistoryRow.js index 905bb5ffa..145185ebe 100644 --- a/frontend/src/Activity/History/HistoryRow.js +++ b/frontend/src/Activity/History/HistoryRow.js @@ -6,7 +6,6 @@ import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellCo import TableRow from 'Components/Table/TableRow'; import TableRowCell from 'Components/Table/Cells/TableRowCell'; import episodeEntities from 'Episode/episodeEntities'; -import SeasonEpisodeNumber from 'Episode/SeasonEpisodeNumber'; import EpisodeTitleLink from 'Episode/EpisodeTitleLink'; import EpisodeLanguage from 'Episode/EpisodeLanguage'; import EpisodeQuality from 'Episode/EpisodeQuality'; @@ -54,9 +53,9 @@ class HistoryRow extends Component { render() { const { - episodeId, - series, - episode, + albumId, + artist, + album, language, quality, eventType, @@ -70,7 +69,7 @@ class HistoryRow extends Component { onMarkAsFailedPress } = this.props; - if (!episode) { + if (!album) { return null; } @@ -97,28 +96,12 @@ class HistoryRow extends Component { ); } - if (name === 'series.sortTitle') { + if (name === 'artist.sortName') { return ( - - ); - } - - if (name === 'episode') { - return ( - - ); @@ -128,10 +111,10 @@ class HistoryRow extends Component { return ( @@ -234,9 +217,9 @@ class HistoryRow extends Component { } HistoryRow.propTypes = { - episodeId: PropTypes.number, - series: PropTypes.object.isRequired, - episode: PropTypes.object, + albumId: PropTypes.number, + artist: PropTypes.object.isRequired, + album: PropTypes.object, language: PropTypes.object.isRequired, quality: PropTypes.object.isRequired, eventType: PropTypes.string.isRequired, diff --git a/frontend/src/Activity/Queue/Queue.js b/frontend/src/Activity/Queue/Queue.js index 621e4ac37..fefde01e3 100644 --- a/frontend/src/Activity/Queue/Queue.js +++ b/frontend/src/Activity/Queue/Queue.js @@ -100,7 +100,7 @@ class Queue extends Component { isPopulated, error, items, - isEpisodesPopulated, + isAlbumsPopulated, columns, totalRecords, isGrabbing, @@ -119,7 +119,7 @@ class Queue extends Component { } = this.state; const isRefreshing = isFetching || isCheckForFinishedDownloadExecuting; - const isAllPopulated = isPopulated && (isEpisodesPopulated || !items.length); + const isAllPopulated = isPopulated && (isAlbumsPopulated || !items.length); const selectedCount = this.getSelectedIds().length; const disableSelectedActions = selectedCount === 0; @@ -191,7 +191,7 @@ class Queue extends Component { return ( { - result.push(item.episode); + result.push(item.album); return result; }, []), ({ id }) => id); diff --git a/frontend/src/Activity/Queue/QueueRow.js b/frontend/src/Activity/Queue/QueueRow.js index 54b0f4276..0f9138911 100644 --- a/frontend/src/Activity/Queue/QueueRow.js +++ b/frontend/src/Activity/Queue/QueueRow.js @@ -132,12 +132,12 @@ class QueueRow extends Component { ); } - if (name === 'series.sortTitle') { + if (name === 'series.sortName') { return ( ); @@ -147,24 +147,8 @@ class QueueRow extends Component { return ( - - ); - } - - if (name === 'episode') { - return ( - - ); @@ -316,7 +300,7 @@ QueueRow.propTypes = { status: PropTypes.string.isRequired, trackedDownloadStatus: PropTypes.string, statusMessages: PropTypes.arrayOf(PropTypes.object), - errorMessage: PropTypes.string.isRequired, + errorMessage: PropTypes.string, series: PropTypes.object.isRequired, episode: PropTypes.object.isRequired, quality: PropTypes.object.isRequired, diff --git a/frontend/src/Calendar/CalendarConnector.js b/frontend/src/Calendar/CalendarConnector.js index 993aeef73..e86dbbcfe 100644 --- a/frontend/src/Calendar/CalendarConnector.js +++ b/frontend/src/Calendar/CalendarConnector.js @@ -51,14 +51,14 @@ class CalendarConnector extends Component { } = this.props; if (hasDifferentItems(prevProps.items, items)) { - const episodeIds = selectUniqueIds(items, 'id'); - const episodeFileIds = selectUniqueIds(items, 'episodeFileId'); + const albumIds = selectUniqueIds(items, 'id'); + // const episodeFileIds = selectUniqueIds(items, 'episodeFileId'); - this.props.fetchQueueDetails({ episodeIds }); + this.props.fetchQueueDetails({ albumIds }); - if (episodeFileIds.length) { - this.props.fetchEpisodeFiles({ episodeFileIds }); - } + // if (episodeFileIds.length) { + // this.props.fetchEpisodeFiles({ episodeFileIds }); + // } } if (prevProps.time !== time) { diff --git a/frontend/src/Calendar/Events/CalendarEvent.js b/frontend/src/Calendar/Events/CalendarEvent.js index 05099d951..9773ba137 100644 --- a/frontend/src/Calendar/Events/CalendarEvent.js +++ b/frontend/src/Calendar/Events/CalendarEvent.js @@ -54,7 +54,7 @@ class CalendarEvent extends Component { // absoluteEpisodeNumber, releaseDate, monitored, - hasFile, + // hasFile, grabbed, queueItem, // timeFormat, @@ -65,7 +65,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, hasFile, downloading, startTime, isMonitored); + const statusStyle = getStatusStyle(id, downloading, startTime, isMonitored); // const missingAbsoluteNumber = artist.seriesType === 'anime' && seasonNumber > 0 && !absoluteEpisodeNumber; return ( @@ -133,7 +133,7 @@ CalendarEvent.propTypes = { // absoluteEpisodeNumber: PropTypes.number, releaseDate: PropTypes.string.isRequired, monitored: PropTypes.bool.isRequired, - hasFile: PropTypes.bool.isRequired, + // hasFile: PropTypes.bool.isRequired, grabbed: PropTypes.bool, queueItem: PropTypes.object, // timeFormat: PropTypes.string.isRequired, diff --git a/frontend/src/Calendar/getStatusStyle.js b/frontend/src/Calendar/getStatusStyle.js index 2201c39a3..3016a10c1 100644 --- a/frontend/src/Calendar/getStatusStyle.js +++ b/frontend/src/Calendar/getStatusStyle.js @@ -1,11 +1,11 @@ import moment from 'moment'; -function getStatusStyle(episodeNumber, hasFile, downloading, startTime, isMonitored) { +function getStatusStyle(episodeNumber, downloading, startTime, isMonitored) { const currentTime = moment(); - if (hasFile) { - return 'downloaded'; - } + // if (hasFile) { + // return 'downloaded'; + // } if (downloading) { return 'downloading'; diff --git a/frontend/src/Store/Reducers/historyReducers.js b/frontend/src/Store/Reducers/historyReducers.js index 7ebca5212..80c6bf441 100644 --- a/frontend/src/Store/Reducers/historyReducers.js +++ b/frontend/src/Store/Reducers/historyReducers.js @@ -27,19 +27,14 @@ export const defaultState = { isModifiable: false }, { - name: 'series.sortTitle', - label: 'Series', + name: 'artist.sortName', + label: 'Artist', isSortable: true, isVisible: true }, - { - name: 'episode', - label: 'Episode', - isVisible: true - }, { name: 'episodeTitle', - label: 'Episode Title', + label: 'Album Title', isVisible: true }, { diff --git a/frontend/src/Store/Reducers/queueReducers.js b/frontend/src/Store/Reducers/queueReducers.js index b313193c2..325518226 100644 --- a/frontend/src/Store/Reducers/queueReducers.js +++ b/frontend/src/Store/Reducers/queueReducers.js @@ -45,19 +45,14 @@ export const defaultState = { isModifiable: false }, { - name: 'series.sortTitle', - label: 'Series', + name: 'series.sortName', + label: 'Artist', isSortable: true, isVisible: true }, - { - name: 'episode', - label: 'Episode', - isVisible: true - }, { name: 'episodeTitle', - label: 'Episode Title', + label: 'Album Title', isVisible: true }, { diff --git a/frontend/src/Store/Selectors/createQueueItemSelector.js b/frontend/src/Store/Selectors/createQueueItemSelector.js index 3d1eeb766..a844bd050 100644 --- a/frontend/src/Store/Selectors/createQueueItemSelector.js +++ b/frontend/src/Store/Selectors/createQueueItemSelector.js @@ -11,7 +11,7 @@ function createQueueItemSelector() { } return _.find(details.items, (item) => { - return item.episode.id === episodeId; + return item.album.id === episodeId; }); } ); diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js index 8a03e366d..bd4d44277 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js @@ -51,10 +51,10 @@ class CutoffUnmetConnector extends Component { componentDidUpdate(prevProps) { if (hasDifferentItems(prevProps.items, this.props.items)) { - const episodeIds = selectUniqueIds(this.props.items, 'id'); + const albumIds = selectUniqueIds(this.props.items, 'id'); const episodeFileIds = selectUniqueIds(this.props.items, 'episodeFileId'); - this.props.fetchQueueDetails({ episodeIds }); + this.props.fetchQueueDetails({ albumIds }); if (episodeFileIds.length) { this.props.fetchEpisodeFiles({ episodeFileIds }); diff --git a/frontend/src/Wanted/Missing/MissingConnector.js b/frontend/src/Wanted/Missing/MissingConnector.js index be74f4f12..3bb327b91 100644 --- a/frontend/src/Wanted/Missing/MissingConnector.js +++ b/frontend/src/Wanted/Missing/MissingConnector.js @@ -48,8 +48,8 @@ class MissingConnector extends Component { componentDidUpdate(prevProps) { if (hasDifferentItems(prevProps.items, this.props.items)) { - const episodeIds = selectUniqueIds(this.props.items, 'id'); - this.props.fetchQueueDetails({ episodeIds }); + const albumIds = selectUniqueIds(this.props.items, 'id'); + this.props.fetchQueueDetails({ albumIds }); } } diff --git a/src/Lidarr.Api.V3/Albums/AlbumModule.cs b/src/Lidarr.Api.V3/Albums/AlbumModule.cs index 0f9a181e9..1a10e2ad6 100644 --- a/src/Lidarr.Api.V3/Albums/AlbumModule.cs +++ b/src/Lidarr.Api.V3/Albums/AlbumModule.cs @@ -27,16 +27,28 @@ namespace Lidarr.Api.V3.Albums private List GetAlbums() { - if (!Request.Query.ArtistId.HasValue) + var artistIdQuery = Request.Query.ArtistId; + var albumIdsQuery = Request.Query.AlbumIds; + + if (!Request.Query.ArtistId.HasValue && !albumIdsQuery.HasValue) { - throw new BadRequestException("artistId is missing"); + throw new BadRequestException("artistId or albumIds must be provided"); + } + + if (artistIdQuery.HasValue) + { + int artistId = Convert.ToInt32(artistIdQuery.Value); + + return MapToResource(_albumService.GetAlbumsByArtist(artistId), false); } - var artistId = (int)Request.Query.ArtistId; + string episodeIdsValue = albumIdsQuery.Value.ToString(); - var resources = MapToResource(_albumService.GetAlbumsByArtist(artistId), false); + var episodeIds = episodeIdsValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(e => Convert.ToInt32(e)) + .ToList(); - return resources; + return MapToResource(_albumService.GetAlbums(episodeIds), false); } private Response SetAlbumMonitored(int id) diff --git a/src/Lidarr.Api.V3/Queue/QueueDetailsModule.cs b/src/Lidarr.Api.V3/Queue/QueueDetailsModule.cs index 37bc6dd09..4adda5669 100644 --- a/src/Lidarr.Api.V3/Queue/QueueDetailsModule.cs +++ b/src/Lidarr.Api.V3/Queue/QueueDetailsModule.cs @@ -33,23 +33,23 @@ namespace Lidarr.Api.V3.Queue var pending = _pendingReleaseService.GetPendingQueue(); var fullQueue = queue.Concat(pending); - var seriesIdQuery = Request.Query.SeriesId; - var episodeIdsQuery = Request.Query.EpisodeIds; + var artistIdQuery = Request.Query.ArtistId; + var albumIdsQuery = Request.Query.AlbumIds; - if (seriesIdQuery.HasValue) + if (artistIdQuery.HasValue) { - return fullQueue.Where(q => q.Artist.Id == (int)seriesIdQuery).ToResource(includeSeries, includeEpisode); + return fullQueue.Where(q => q.Artist.Id == (int)artistIdQuery).ToResource(includeSeries, includeEpisode); } - if (episodeIdsQuery.HasValue) + if (albumIdsQuery.HasValue) { - string episodeIdsValue = episodeIdsQuery.Value.ToString(); + string albumIdsValue = albumIdsQuery.Value.ToString(); - var episodeIds = episodeIdsValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + var albumIds = albumIdsValue.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) .Select(e => Convert.ToInt32(e)) .ToList(); - return fullQueue.Where(q => episodeIds.Contains(q.Episode.Id)).ToResource(includeSeries, includeEpisode); + return fullQueue.Where(q => albumIds.Contains(q.Album.Id)).ToResource(includeSeries, includeEpisode); } return fullQueue.ToResource(includeSeries, includeEpisode);