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

Support loading multiple file URLs (CLI/file managers) #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshuamegnauth54
Copy link
Contributor

@joshuamegnauth54 joshuamegnauth54 commented Feb 11, 2025

Closes: #44

This patch adds support for starting COSMIC Player with multiple, mixed URLs. As in #75, this is primarily useful for file managers which may start the program with multiple files and folders.

I added pico-args as a dependency to aid argument parsing. pico-args doesn't have any dependencies and only adds 1KB of binary bloat as opposed to clap which adds almost a megabyte of bloat. I used a dependency instead of simply looping through the arguments because I assume that command line args will be added in the future, so I might as well implement this the right way instead of adding maintenance burden.

I did not update the Open File button to take advantage of the new functionality. However, it should be a lot easier now to support that in a future patch.

Closes: pop-os#44, pop-os#47

I used pico-args over clap because the former only adds about 1KB of
binary bloat whereas clap adds almost 1MB.
Prior to this commit, projects/playlists were limited to folders even if
file URLs were passed as arguments. With this commit both files and
folders are added to projects from the command line.

This doesn't affect opening a file from the GUI yet, but this patch
implements the required plumbing for that as well.
@joshuamegnauth54 joshuamegnauth54 changed the title Support loading multiple file URLs Support loading multiple file URLs (CLI/file managers) Feb 13, 2025
@joshuamegnauth54 joshuamegnauth54 marked this pull request as ready for review February 13, 2025 08:02
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.

[Feature Request] Add Feature to Queue Media Files When Multiple Files Are Launched via File Manager
1 participant