mime types and UMS devices

View: New views
4 Messages — Rating Filter:   Alert me  

mime types and UMS devices

by Aran Cox-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I found that there is a handy utility (shipped as a part of the
kdebase-runtime package on my system) called kmimetypefinder.

http://websvn.kde.org/trunk/KDE/kdebase/runtime/kmimetypefinder/kmimetypefinder.cpp?view=markup

kmimetypefinder with the -c option specified does exactly what
UmsHandler.cpp does (calls findByFileContent).  findByFileContent only
looks at the content of the file, not the path so because the
definition for audio/x-flac was only defined by a suffix, it was never
going to match.  kmimetypefinder by default uses findByPath which
allows matches by path name and file content.  When I modified
UmsHandler.cpp to use findByPath it found all my files on my Sansa
including the mp3's that weren't getting matched correctly before and
the flac's.  (Although, clearly the flac definition in
freedesktop.org.xml was incomplete and needed to be fixed anyway.)

I'm of the mind that we should use findByPath() because it solves my problems :)

On a related note, I would really like to use a loopback vfat
filesystem for testing this stuff.  How to I trick amarok into seeing
a directory or other filesystem as something that it would manage as a
UMS device?

I'll attach the patch, although it's trivial.

Cheers!


_______________________________________________
Amarok mailing list
Amarok@...
https://mail.kde.org/mailman/listinfo/amarok

mimetype.diff (1K) Download Attachment

Re: mime types and UMS devices

by Bugzilla from mitchell@kde.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Aran Cox wrote:

> kmimetypefinder with the -c option specified does exactly what
> UmsHandler.cpp does (calls findByFileContent).  findByFileContent only
> looks at the content of the file, not the path so because the
> definition for audio/x-flac was only defined by a suffix, it was never
> going to match.  kmimetypefinder by default uses findByPath which
> allows matches by path name and file content.  When I modified
> UmsHandler.cpp to use findByPath it found all my files on my Sansa
> including the mp3's that weren't getting matched correctly before and
> the flac's.  (Although, clearly the flac definition in
> freedesktop.org.xml was incomplete and needed to be fixed anyway.)
>
> I'm of the mind that we should use findByPath() because it solves my problems :)
Personally, I'm of the mind that we should try one (preferably content)
and fall back to the other (filename) if nothing is found. Can you
modify your patch to do that?

> On a related note, I would really like to use a loopback vfat
> filesystem for testing this stuff.  How to I trick amarok into seeing
> a directory or other filesystem as something that it would manage as a
> UMS device?

Not sure...xevix?

--Jeff



_______________________________________________
Amarok mailing list
Amarok@...
https://mail.kde.org/mailman/listinfo/amarok

signature.asc (269 bytes) Download Attachment

Re: mime types and UMS devices

by Aran Cox-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Oct 16, 2009 at 8:38 PM, Jeff Mitchell <mitchell@...> wrote:
>> I'm of the mind that we should use findByPath() because it solves my problems :)
>
> Personally, I'm of the mind that we should try one (preferably content)
> and fall back to the other (filename) if nothing is found. Can you
> modify your patch to do that?

OK!


_______________________________________________
Amarok mailing list
Amarok@...
https://mail.kde.org/mailman/listinfo/amarok

tryboth.diff (1K) Download Attachment

Re: mime types and UMS devices

by Bugzilla from mitchell@kde.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Aran Cox wrote:
> On Fri, Oct 16, 2009 at 8:38 PM, Jeff Mitchell <mitchell@...> wrote:
>>> I'm of the mind that we should use findByPath() because it solves my problems :)
>> Personally, I'm of the mind that we should try one (preferably content)
>> and fall back to the other (filename) if nothing is found. Can you
>> modify your patch to do that?
>
> OK!

Thanks!

Applied (slightly modified for safety) in 72c81f3.

--Jeff



_______________________________________________
Amarok mailing list
Amarok@...
https://mail.kde.org/mailman/listinfo/amarok

signature.asc (269 bytes) Download Attachment