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

Open entire folder from Files #709

Closed
Oowoosh0 opened this issue May 17, 2022 · 8 comments · Fixed by #747
Closed

Open entire folder from Files #709

Oowoosh0 opened this issue May 17, 2022 · 8 comments · Fixed by #747

Comments

@Oowoosh0
Copy link

Problem

Currently it is not possible to right click on a folder in Files and open it in Music, so that all audio files in that folder get put into the playlist. You have to enter the folder, select all files and then open them in with Music which seem like an overcomplicated way of doing that.

Proposal

Make it possible to just open an entire folder with Music and have all audio files in that folder appear in the queue.

Prior Art (Optional)

No response

@jeremypw
Copy link
Collaborator

jeremypw commented Feb 5, 2023

Need to amend the .descktop for this app to indicate that it accepts a folder as a commandline argument (and add the code so that it does!)

@ghost
Copy link

ghost commented Mar 27, 2023

As a workaround, select all files in that folder, right click, and use "open with music".

Can I work on this? Would it be just modify the .desktop file? If so, in what way? Any code changes needed? I would say so but it should be as simple if the selected file is a folder, and if it is, open all files from it.

@jeremypw
Copy link
Collaborator

Would it be just modify the .desktop file? If so, in what way? Any code changes needed? I would say so but it should be as simple if the selected file is a folder, and if it is, open all files from it.

Essentially yes, that is the approach. You would have to deal with the cases that the folder contains no music files or a ridiculously large number of files though.

@jeremypw
Copy link
Collaborator

jeremypw commented Mar 27, 2023

I guess you would have to amend the "MimeTypes" key. See https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html. The mimetype of a folder is inode/directory

@ghost
Copy link

ghost commented Apr 3, 2023

I see we need to support many scenarios, like opening a folder from file explorer, dragging a folder onto the app, and m3u8 files. Isn't there a way to abstract the code so it can support more formats in the future?

@jeremypw
Copy link
Collaborator

jeremypw commented Apr 3, 2023

I'll try and review your PR in the near future. I imagine that some functions can be abstracted into a utility class that can be easily accessed from different parts of the program. That is what e.g. Files does for various process on files.

@ghost
Copy link

ghost commented Apr 3, 2023

I think the same. The main Application class shouldn't have this much responsibilities. But I didn't know how to do it in a more structured way when I started writing the PR.

Open to suggestions! Besides, the code works and I can now open folders from Music, but obviously we shouldn't deliver unstable code.

@jeremypw
Copy link
Collaborator

jeremypw commented Apr 3, 2023

Opening from Files and drag-drop now works in the current PR. I think we can revisit the code structure if necessary when we look at m3u8 files in a separate PR. The code will not be released to users yet anyway.

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 a pull request may close this issue.

2 participants