Skip to content

Fixes: #2212 ; Feature: Skip Duplicate Song from Sub-Folders ; Fixed #2214

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

Merged

Conversation

himanshumahajan138
Copy link
Member

Title

Fixes: #2212 ; Feature: Skip Duplicate Song from Sub-Folders ; Fixed

Description

This PR Fixes the issue of re-downloading duplicate songs if they exist in subfolders and fixed the output structure for downloaded files

Related Issue

Fixes: #2212

Motivation and Context

User faces problem in skipping duplicate files present in subfolders and a generalized folder structure, so this PR fixed this problem

How Has This Been Tested?

Performed download testing with different overwrite options to check working of the updated code

Types of Changes

  • Feature: Updated Code for Skipping Downloading of duplicate files from the subfolders

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have read the CORE VALUES document
  • I have added tests to cover my changes
  • All new and existing tests passed

@himanshumahajan138
Copy link
Member Author

@GGussi @xnetcat Sir please Review my PR and Merge if Satisfied...

if any changes are required then please review the changes...

Copy link

@kiruthikpurpose kiruthikpurpose left a comment

Choose a reason for hiding this comment

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

Good way of handling errors in general.

@himanshumahajan138
Copy link
Member Author

Thanks @kiruthikpurpose for your review...
If everything is working fine then can we move to merge this PR

Comment on lines +457 to +468

# Update output path using song.album_name if valid; otherwise, use song.artist.
output_file = (
Path("output")
/ (
Path(song.album_name)
if Path(song.album_name).is_dir()
else Path(song.artist)
)
/ output_file
)

Copy link
Member

Choose a reason for hiding this comment

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

What's this for?

Copy link
Member

Choose a reason for hiding this comment

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

@himanshumahajan138
I saw you added output/ into the .gitignore as well. Can you elaborate on this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually although you have added mp3 files in the .gitignore but when i was testing it i just added output folder for myself we can remove it, it was just my testing part

Copy link
Member

Choose a reason for hiding this comment

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

Can you make a PR removing both of these please? Seems they slipped through the cracks in the haste of approving the PR :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ya sure i will do this by today positively...

Comment on lines +511 to +515
# Checking if file already exists in all subfolders of output directory
file_exists = (
next(Path(output_file.parts[0]).rglob(output_file.name), None)
or dup_song_paths
)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it's good idea to perform rglob every time we check if a file exists. This should be done once in the init function to construct a dict (?)

@xnetcat
Copy link
Member

xnetcat commented Oct 19, 2024

Also I think it would be better to add tis functionality as a command line argument, to not break the current behavior for other users.

@xnetcat
Copy link
Member

xnetcat commented Oct 19, 2024

I can merge this one, and improve the code later if you need PR for hacktoberfest ;)

@himanshumahajan138
Copy link
Member Author

I can merge this one, and improve the code later if you need PR for hacktoberfest ;)

So nice of you man, ok then merge this one and i will raise a new pr in morning with next updates

Thanks for your understanding 😊

@xnetcat xnetcat merged commit e9ece49 into spotDL:master Oct 21, 2024
xnetcat pushed a commit that referenced this pull request Oct 21, 2024
…2214)

Co-authored-by: Mill GithHub Actions <mill-ci@localhost>
@Silverarmor
Copy link
Member

Hi @himanshumahajan138 @kiruthikpurpose

Great to see you around the spotDL project. We are always on the lookout for more volunteers to contribute to spotDL.
Would you be interested in joining the spotDL development team?

Thanks for your contributions thus far.
You can also join the spotDL discord @ https://discord.gg/xCa23pwJWY

@himanshumahajan138
Copy link
Member Author

himanshumahajan138 commented Nov 2, 2024

Hi @himanshumahajan138 @kiruthikpurpose

Great to see you around the spotDL project. We are always on the lookout for more volunteers to contribute to spotDL. Would you be interested in joining the spotDL development team?

Thanks for your contributions thus far. You can also join the spotDL discord @ https://discord.gg/xCa23pwJWY

I am interested in joining spotDL developement Team and help the community with contributions
@Silverarmor what are the next steps.... ?

@Silverarmor
Copy link
Member

Thanks @himanshumahajan138.
I've added you to the GitHub organisation. You should receive an email or you can accept it at https://github.com/spotDL within 7 days.

Please join the spotDL Discord and mention me (@Silverarmor) so I can link your discord to your GH account. From that - simply discuss in the dev channels, or work on PRs/issues!

xnetcat added a commit that referenced this pull request Nov 15, 2024
@xnetcat xnetcat mentioned this pull request Nov 15, 2024
@himanshumahajan138 himanshumahajan138 deleted the feature/skip-subfolders-downloading branch November 19, 2024 13:14
Silverarmor added a commit that referenced this pull request Nov 23, 2024
This was inadvertently committed to spotDL.
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.

Skim Through Download Directory Subfolders for Skippable Song
4 participants