#766 Resolves issue with playlist alias editor clone alias feature causing multiple copies of alias. Changed clone feature to only use a shallow copy (no ids or actions). Removed alias event framework from code since all change notifications can now be detected by the alias model's aliasList property. (#791)

Co-authored-by: Denny <denny@denny-desktop>
This commit is contained in:
Denny Sheirer
2020-05-04 10:20:49 +00:00
committed by GitHub
parent 08ea0e0f18
commit 5d580544e7
10 changed files with 248 additions and 442 deletions

View File

@@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.dataformat.xml.JacksonXmlModule;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import io.github.dsheirer.alias.Alias;
import io.github.dsheirer.alias.AliasModel;
import io.github.dsheirer.audio.broadcast.BroadcastModel;
import io.github.dsheirer.controller.channel.Channel.ChannelType;
@@ -41,6 +42,7 @@ import io.github.dsheirer.service.radioreference.RadioReference;
import io.github.dsheirer.source.SourceManager;
import io.github.dsheirer.source.tuner.TunerModel;
import io.github.dsheirer.util.ThreadPool;
import javafx.collections.ListChangeListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -108,10 +110,7 @@ public class PlaylistManager implements Listener<ChannelEvent>
//save the playlist when there are any changes
mChannelModel.addListener(this);
mAliasModel.addListener(t -> {
//Save the playlist for all alias events
schedulePlaylistSave();
});
mAliasModel.aliasList().addListener((ListChangeListener<Alias>)c -> schedulePlaylistSave());
mChannelMapModel.addListener(t -> {
//Save the playlist for all channel map events