Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite track file with unique tracks #380

Merged
merged 1 commit into from
Oct 2, 2018
Merged

Conversation

ritiek
Copy link
Member

@ritiek ritiek commented Oct 1, 2018

Closes #370.

Fix this by filtering duplicates from track file and re-writing track file with unique tracks so that tracks from track file are deleted in proper order.

@ritiek
Copy link
Member Author

ritiek commented Oct 1, 2018

This PR also adds a new function internals.get_unique_tracks which, given path to track file will return a list of unique tracks from the track file. And also a couple of tests!

with open(text_file, 'r') as listed:
# read tracks into a list and remove any duplicates
lines = listed.read().splitlines()
lines = list(set(lines))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the new remove_duplicates function here IMO...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this seems to be causing a merge conflict.

spotdl/internals.py Show resolved Hide resolved
@linusg
Copy link
Contributor

linusg commented Oct 1, 2018

Tests are always good! 😁

@ritiek
Copy link
Member Author

ritiek commented Oct 2, 2018

I also rebased this branch against master and should be ready to merge.

@linusg linusg merged commit 9703bec into master Oct 2, 2018
@linusg linusg deleted the duplicates-in-file branch October 2, 2018 07:16
@linusg
Copy link
Contributor

linusg commented Oct 2, 2018

Awesome!

@ritiek ritiek added this to the v1.1.0 milestone Nov 13, 2018
@ritiek ritiek mentioned this pull request Nov 13, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants