mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-23 22:25:09 -04:00
Add Tracklist to Album Modal
This commit is contained in:
@@ -7,6 +7,8 @@ import { toggleEpisodeMonitored } from 'Store/Actions/episodeActions';
|
||||
import createEpisodeSelector from 'Store/Selectors/createEpisodeSelector';
|
||||
import createArtistSelector from 'Store/Selectors/createArtistSelector';
|
||||
import episodeEntities from 'Episode/episodeEntities';
|
||||
import { fetchTracks, clearTracks } from 'Store/Actions/trackActions';
|
||||
import { fetchEpisodeFiles, clearEpisodeFiles } from 'Store/Actions/episodeFileActions';
|
||||
import EpisodeDetailsModalContent from './EpisodeDetailsModalContent';
|
||||
|
||||
function createMapStateToProps() {
|
||||
@@ -34,6 +36,10 @@ function createMapStateToProps() {
|
||||
|
||||
const mapDispatchToProps = {
|
||||
clearReleases,
|
||||
fetchTracks,
|
||||
clearTracks,
|
||||
fetchEpisodeFiles,
|
||||
clearEpisodeFiles,
|
||||
toggleEpisodeMonitored
|
||||
};
|
||||
|
||||
@@ -41,14 +47,33 @@ class EpisodeDetailsModalContentConnector extends Component {
|
||||
|
||||
//
|
||||
// Lifecycle
|
||||
componentDidMount() {
|
||||
this._populate();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
// Clear pending releases here so we can reshow the search
|
||||
// results even after switching tabs.
|
||||
|
||||
this._unpopulate();
|
||||
this.props.clearReleases();
|
||||
}
|
||||
|
||||
//
|
||||
// Control
|
||||
|
||||
_populate() {
|
||||
const artistId = this.props.artistId;
|
||||
const albumId = this.props.episodeId;
|
||||
this.props.fetchTracks({ artistId, albumId });
|
||||
// this.props.fetchEpisodeFiles({ artistId, albumId });
|
||||
}
|
||||
|
||||
_unpopulate() {
|
||||
this.props.clearTracks();
|
||||
// this.props.clearEpisodeFiles();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Listeners
|
||||
|
||||
@@ -82,6 +107,10 @@ EpisodeDetailsModalContentConnector.propTypes = {
|
||||
episodeId: PropTypes.number.isRequired,
|
||||
episodeEntity: PropTypes.string.isRequired,
|
||||
artistId: PropTypes.number.isRequired,
|
||||
fetchTracks: PropTypes.func.isRequired,
|
||||
clearTracks: PropTypes.func.isRequired,
|
||||
fetchEpisodeFiles: PropTypes.func.isRequired,
|
||||
clearEpisodeFiles: PropTypes.func.isRequired,
|
||||
clearReleases: PropTypes.func.isRequired,
|
||||
toggleEpisodeMonitored: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user