HermesApp / Hermes

Compact macOS Pandora client that doesn’t use Flash
http://hermesapp.org/
MIT License
381 stars 99 forks source link

Prevent duplicate stations and seeds (#320) #324

Open Raab70 opened 6 years ago

Raab70 commented 6 years ago

I am not an expert in objective-C by any means so feel free to tear apart but I wanted to get my feet wet. This addresses #320 by simply returning if a duplicate seed is added. I also noticed that this behavior existed for adding duplicate stations so now if you try to add a duplicate station it will just start playing the existing one.

nriley commented 6 years ago

Thanks, your contribution is appreciated! I haven't had a chance to apply the patch yet but if you could address the issues I mentioned in my review and let me know what a 'duplicate station' is…not sure what you mean here!

Raab70 commented 6 years ago

@nriley Not sure what you mean by address the comments from your review, I'm not seeing any comments other than the one above.

To clarify on what I mean by duplicate stations, basically you can follow the steps in #320 but with stations.

  1. Add a station from an artist
  2. That station begins playing
  3. Add another station from the same artist
  4. Now "both" stations are playing in the UI since they point to the same station
  5. Delete either station, it will delete both (or all) of them

This is because it is really just a duplicate reference in the Hermes UI to the same Pandora station. This check just keeps the UI clear. If a user tries to add a station which already exists, it simply takes them to play the station they have which exists.

screenshot 2017-12-13 19 25 35
Raab70 commented 6 years ago

Also note that a quit and restart of the app will clean up the station list. The same is true of the seeds list, exiting the Edit Station window and reopening it will clean up the list, this just prevents it from getting into that state.

nriley commented 6 years ago

Thanks for the clarification on the duplicate stations — makes sense. Sorry, it's been a while since I used GitHub's review functionality and I didn't realize I had to submit it before you could see it!