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

Local opus files ignored if Title tag contains a dot #80

Open
elvisangelaccio opened this issue Mar 3, 2017 · 4 comments
Open

Local opus files ignored if Title tag contains a dot #80

elvisangelaccio opened this issue Mar 3, 2017 · 4 comments

Comments

@elvisangelaccio
Copy link

elvisangelaccio commented Mar 3, 2017

Hi, I was investigating why some of my opus songs would not show up in the Tomahawk Android app. Eventually I figured out that the app does not list files whose Title tag contains a dot, for example L.A. Woman of The Doors. If I rename the tag removing the dots, the song shows up as expected...

mp3 files are not affected, it seems a bug specific to the opus format (or maybe to every format that uses the Vorbis tags for metadata?)

Version of the app is 0.986_armeabi-v7a

@elvisangelaccio
Copy link
Author

Ok I think I figured out what's going on:

D/UserCollection: Processed 15 media items. 13 tracks have been added to the UserCollection

The two missing tracks are the ones with a dot in their title. They are not added because they have MediaWrapper.TYPE_ALL instead of MediaWrapper.TYPE_AUDIO.

I added some more debug in UserCollections.java and MediaWrapper.java, and it looks like the faulty media items might come from vlc?

// create new media item
final Media media = new Media(VLCMediaPlayer.getLibVlcInstance(),
    Uri.parse(fileURI));

@elvisangelaccio
Copy link
Author

The following workaround fixes the issue, but of course is just a workaround.

diff --git a/app/src/main/java/org/tomahawk/libtomahawk/collection/UserCollection.java b/app/src/main/java/org/tomahawk/libtomahawk/collection/UserCollection.java
index b9763f0f..abfa9bb7 100644
--- a/app/src/main/java/org/tomahawk/libtomahawk/collection/UserCollection.java
+++ b/app/src/main/java/org/tomahawk/libtomahawk/collection/UserCollection.java
@@ -342,7 +342,7 @@ public class UserCollection extends DbCollection {
             }
             List<ScriptResolverTrack> tracks = new ArrayList<>();
             for (MediaWrapper mw : mws) {
-                if (mw.getType() == MediaWrapper.TYPE_AUDIO) {
+                if (mw.getType() == MediaWrapper.TYPE_AUDIO || mw.getUri().toString().endsWith("opus")) {

@elvisangelaccio
Copy link
Author

it looks like the faulty media items might come from vlc?

Nope, this is a bug in MediaWrapper's defineType() method. Going to submit a PR soon.

@muesli
Copy link
Member

muesli commented Mar 4, 2017

Nice!

elvisangelaccio added a commit to elvisangelaccio/tomahawk-android that referenced this issue Mar 4, 2017
Otherwise the type detection will break as soon as the track title
contains a dot, e.g. 'L.A. Woman' by The Doors.

Fixes tomahawk-player#80
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

No branches or pull requests

2 participants