! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Add common multimedia player entries to the "Send to..." menu (partial patch)
Status:
RESOLVED: WONTFIX
Severity:
enhancement

Comments

Description Julien [nodiscc] editbugs 2018-04-19 22:14:01 CEST
Created attachment 7669 
.desktop launchers for integration in the sendto menu

Hello, I originally reported this to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890837, I was advised to help porting it here instead.

My changes add mpv/audacious/vlc play/enqueue entries to the right-click "Send to..." submenu. The advantages of doing this instead of relying on UCAs are:

 * It supports localized entries (UCAs don't support title localization...)
 * Entries are automatically hidden when the required program is not installed (TryExec field) (in UCAs it is always shown even if the player is not installed)
 * It does not clutter the main right-click menu and "Send to..." is a good place to look for this kind of functionality
 * I think it is better than implementing a plugin for it, easily maintainable, leverages existing functionality, can be used for non-multimedia programs in the future...

The patch is against the thunar-data https://packages.debian.org/buster/thunar-data package in Debian, I don't knows where this fits in the xfce tree. The files in this package come from thunar and https://sources.debian.org/src/exo/0.12.0-1/exo-helper/helpers/.

We have looked in both repositories on IRC and could not find an existing mechanism to install .desktop.in launchers in the sendto directory.
Comment 1 Julien [nodiscc] editbugs 2018-04-19 22:24:18 CEST
Created attachment 7670 
gnome-obex-send.desktop
Comment 2 Julien [nodiscc] editbugs 2018-04-19 22:24:45 CEST
There are 2 other files in the package from a Debian-specific patch:
https://packages.debian.org/buster/all/thunar-data/filelist
/usr/share/Thunar/sendto/bluetooth-sendto.desktop
/usr/share/Thunar/sendto/gnome-obex-send.desktop
Comment 3 Julien [nodiscc] editbugs 2018-04-19 22:26:18 CEST
Created attachment 7671 
bluetooth-sendto.desktop
Comment 4 alexxcons editbugs 2018-04-25 00:54:08 CEST
Created attachment 7680 
Added plugin thunar-sendto-multimedia

Attached a thunar-plugin which should allow multi-language support & install the files at the right position. Already works fine for me.

- removed the (play) buttons, since you get them already in the "open with" menu
- removed mpv, since it seems not to be able to "add to playlist"
- added parole, since this is the default media-player of xfce !!
- added argument --one-instance for vlc .. otherwise it will play stuff in parallel

Many things remaining to do:
- is the name "thunar-sendto-multimedia" fine ?
- Should I possibly merge it with "thunar-sendto-email" and name it e.g. "thunar-sendto-extensions"
- Check if this should be kept as plugin ( could as well just be added to some folder "sendto" within thunar )
- Check if the plugin should go into the thunar repo, or somewhere else (external)
- Check if the mime-types of parole are all supported (I just copied the vlc -types)
- Check for other video/audio players (.. do we have a xfce default audio-player? )
Comment 5 Julien [nodiscc] editbugs 2018-04-25 19:00:31 CEST
Hi, thanks for considering this bug report

> - removed the (play) buttons, since you get them already in the "open with" menu
> - removed mpv, since it seems not to be able to "add to playlist"

Nope, that's the point and why I added this in the dirst place: the "open with" menu is not shown for directories! Hence you can not play/enqueue a whole directory from the menu (you have to drag and drop it). Would you consider re-adding them?

> - added argument --one-instance for vlc .. otherwise it will play stuff in parallel

Nice, indeed.

> - Check if this should be kept as plugin ( could as well just be added to some folder "sendto" within thunar )
>- Should I possibly merge it with "thunar-sendto-email" and name it e.g. "thunar-sendto-extensions"

I have no strong feelings about this, I thought the debian way of just adding .desktop files to the proper location (/usr/share/Thunar/sendto/) was simple enough, it's already there so why not use it... but do it any way you like. Yes I think it should be something generic like "thunar-sendto-extensions"

Thanks again
Comment 6 alexxcons editbugs 2018-04-25 22:54:38 CEST
Created attachment 7681 
patch to add many .desktop files

- added .desktop files for Banshee and SMPLayer
- added .desktop file for parole (missed to add to last patch)
- removed folder-support for parole

> > - removed the (play) buttons, since you get them already in the "open with" menu
> 
> Nope, that's the point and why I added this in the dirst place: the "open
> with" menu is not shown for directories! Hence you can not play/enqueue a
> whole directory from the menu (you have to drag and drop it). Would you
> consider re-adding them?
> 
For VLC, Audacious, Banshee and SMPLayer it works fine for me to enqueue directories via "sentto". Just parole has a bug on that :X (opened bug #14354)
Please, take a try for it !

TODO: Check supported mime-types for all players
Comment 7 Andre Miranda editbugs 2018-04-26 03:44:03 CEST
As far as I understand, the problem here is to open multiple files/folders with an application, in this case a multimedia player, due Thunar limitations:

1) Currently if one selects multiple files and press enter, Thunar will open the last one selected, as reported in Bug #2487. It's possible to work this around by right clicking one of selected files and choose Open With "Something".

2) It's not possible to open a folder with an application (couldn't find any bug for this).

As mentioned, User Custom Actions can be used to overcome these limitations, but they are not i18n-friendly and it's not easy for packagers to ship these UCAs, since they share the same file (uca.xml).

IMO the proposed approach is not a proper solution either, but another workaround:
- It makes no sense to "Send" files to an application, no file is copied or moved
- Not exactly intuitive/obvious
- One more stuff to maintain (these .desktop files)

Having said that, I think the right thing to do™ is address to both limitations accordingly (only after 1.8.0, since we're on feature freeze).
If everyone agrees, we should file a bug for the second limitation and close this one.
Comment 8 alexxcons editbugs 2018-04-26 21:30:14 CEST
Ok for me .. ( actually I overlooked that "add to playlist" already is the default action for opening media files :F. Wonder how the players are launched correctly. ... so as you said, only missing "open with XXX (Add to playlist)" for folders )
Comment 9 alexxcons editbugs 2018-04-26 22:47:30 CEST
Just opened a bug for 2) :  Bug #14359
Comment 10 alexxcons editbugs 2018-05-01 21:19:29 CEST
Closed as "wontfix", due to there is a prior approach to add the required functionality to thunar.
The feature to add folders to a playlist will be provided by Bug #14359

Bug #14345

Reported by:
Julien [nodiscc]
Reported on: 2018-04-19
Last modified on: 2018-05-01

People

Assignee:
alexxcons
CC List:
4 users

Version

Version:
unspecified

Attachments

.desktop launchers for integration in the sendto menu (7.82 KB, patch)
2018-04-19 22:14 CEST , Julien [nodiscc]
no flags
gnome-obex-send.desktop (135 bytes, application/x-desktop)
2018-04-19 22:24 CEST , Julien [nodiscc]
no flags
bluetooth-sendto.desktop (126 bytes, application/x-desktop)
2018-04-19 22:26 CEST , Julien [nodiscc]
no flags
Added plugin thunar-sendto-multimedia (8.12 KB, patch)
2018-04-25 00:54 CEST , alexxcons
no flags
patch to add many .desktop files (11.63 KB, patch)
2018-04-25 22:54 CEST , alexxcons
no flags

Additional information