Skip to content

Commit

Permalink
Save playing unsaved playlist, without tracks selected
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Nov 14, 2023
1 parent 985f7f7 commit e1ec642
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/listfix/model/playlists/Playlist.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public void play()
}
catch (IOException e)
{
_logger.warn(String.format("Launching file: %s", this.playlistPath), e);
_logger.warn(String.format("Failed to launching file: %s", this.playlistPath), e);
}
}

Expand Down
14 changes: 11 additions & 3 deletions src/main/java/listfix/view/controls/PlaylistEditCtrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,15 @@ private void playSelectedEntries()
List<PlaylistEntry> playlistEntries = this.getSelectedPlaylistEntries().stream()
.filter(entry -> entry.isFound() || entry.isURL())
.collect(Collectors.toList());
this.playEntries(playlistEntries);
}
private void playAllEntries()
{
this.playEntries(this.playlist.getEntries());
}

private void playEntries(final List<PlaylistEntry> playlistEntries)
{
try
{
// Get a temp playlist
Expand Down Expand Up @@ -809,14 +817,14 @@ private void onBtnPlayActionPerformed(ActionEvent evt)
}
else
{
if (playlist.isModified())
if (this.playlist.isModified())
{
// this plays all entries if nothing is selected, and plays what the user has in memory
playSelectedEntries();
this.playAllEntries();
}
else
{
playlist.play();
this.playlist.play();
}
}
}
Expand Down

0 comments on commit e1ec642

Please sign in to comment.