After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 564355 - Uri field is using a different format in the DB depending if the file is relative or not, so smart playlists that use FileLocation don't work as expected
Uri field is using a different format in the DB depending if the file is rela...
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: Smart Playlists
1.4.1
Other All
: Normal normal
: 1.x
Assigned To: Gabriel Burt
Gabriel Burt
: 548128 560934 (view as bug list)
Depends on: 570312
Blocks: 563630
 
 
Reported: 2008-12-13 05:54 UTC by Andrés G. Aragoneses (IRC: knocte)
Modified: 2009-04-22 08:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch v1 (7.67 KB, patch)
2009-02-15 07:31 UTC, Andrés G. Aragoneses (IRC: knocte)
none Details | Review
Proposed patch v2 (9.62 KB, patch)
2009-02-28 00:20 UTC, Andrés G. Aragoneses (IRC: knocte)
none Details | Review

Description Andrés G. Aragoneses (IRC: knocte) 2008-12-13 05:54:48 UTC
Please describe the problem:
While the "File location" column displays things like:

/home/user/My Music/Coldplay - Clocks.mp3

The DB stores:

file:///home/user/My%20Music/Coldplay%20-%20Clocks.mp3

As a result, many confused users are filing bugs like bug 548128 or bug 560934. I wanted to create a new bug in order to expose the main reason of all of this bugs and post several issues along with their steps to reproduce.

Steps to reproduce:
1. Have a song in /home/user/.../whatever.mp3
2. Create a smartplaylist with filter File Location Starts With '/home'



Actual results:
whatever.mp3 is not included in the playlist.

Expected results:
whatever.mp3 should be included in the playlist.

Does this happen every time?
Yes.

Other information:
Steps to reproduce:
1. Have a song in /home/user/Music/Rock and Roll/dang dang.mp3
2. Create a smartplaylist with filter File Location Contains 'Rock and Roll"

Actual results:
dang dang.mp3 is not included in the playlist.

Expected results:
dang dang.mp3 should be included in the playlist.
Comment 1 Andrés G. Aragoneses (IRC: knocte) 2009-02-03 00:07:46 UTC
Working on this. I just don't have the bugzilla rights to set to ASSIGNED.
Comment 2 Andrés G. Aragoneses (IRC: knocte) 2009-02-03 05:53:06 UTC
Ok this is going to be tricky. It turns out that the file:///home/.../Hello%20World.mp3 format is not always used. For songs inside /home/user/Music, a normal string is used. We need to uniform this.
Comment 3 Andrés G. Aragoneses (IRC: knocte) 2009-02-15 07:31:02 UTC
Created attachment 128760 [details] [review]
proposed patch v1

Diff against r5038 (includes ChangeLog).
This fixes FileLocation search when files are outside /home/user/Music and the search contains characters affected by escaping (for example a space).
Please review, thanks.
Comment 4 Andrés G. Aragoneses (IRC: knocte) 2009-02-20 05:37:25 UTC
Don't review last patch, consider it obsolete because this bug depends on bug 570312, which I reopened recently. I left there some patches.
Comment 5 Bertrand Lorentz 2009-02-23 14:05:07 UTC
Marking patch as obsolete as per above comment.
Comment 6 Andrés G. Aragoneses (IRC: knocte) 2009-02-28 00:20:35 UTC
Created attachment 129700 [details] [review]
Proposed patch v2

Ok, new version after the bug on which this depends is marked FIXED again.

Beware: the only file that doesn't apply cleanly in this patch is the DB Migrator, because I'm assuming the previous patch I've proposed for bug 573484 is going to be committed as well (so the DB version will be 26, not 25).

It includes unit tests and ChangeLog entry as well.
Comment 7 Andrés G. Aragoneses (IRC: knocte) 2009-02-28 00:22:49 UTC
Hugh, I just realised there's a mistake, I'm creating a new version...
Comment 8 Andrés G. Aragoneses (IRC: knocte) 2009-02-28 00:28:11 UTC
(In reply to comment #7)
> Hugh, I just realised there's a mistake, I'm creating a new version...

Disregard this comment, the patch is fine.
Comment 9 Andrés G. Aragoneses (IRC: knocte) 2009-04-09 00:49:44 UTC
Gabriel has told me on IRC that he has integrated the latest patch in his git branch: http://banshee-project.org/~gburt/banshee.git

I'll check it out and post a new patch for the remaining cases we need to cover in this bug.
Comment 10 Gabriel Burt 2009-04-10 16:50:09 UTC
I've attached the patch to bug #404827, as it's part of adding per-library import folders.
Comment 11 Andrés G. Aragoneses (IRC: knocte) 2009-04-11 22:33:08 UTC
(In reply to comment #10)
> I've attached the patch to bug #404827, as it's part of adding per-library
> import folders.

Hey Gabriel, I don't see any part of the patch in that patch. Maybe what you meant is that the patch here will be obsolete when that patch lands? I haven't tested it yet though.
Comment 12 Andrés G. Aragoneses (IRC: knocte) 2009-04-17 01:04:21 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > I've attached the patch to bug #404827, as it's part of adding per-library
> > import folders.
> 
> Hey Gabriel, I don't see any part of the patch in that patch. Maybe what you
> meant is that the patch here will be obsolete when that patch lands? I haven't
> tested it yet though.
> 

I've seen the commit now, and I confirm this bug is now fixed for *all* the cases.

I wonder if you didn't like my patch in the first place because you were thinking it was worth it to use absolute URIs for all cases in the end: well, indeed, we already had talked about this in IRC and I was advocating that approach, but you told me it had to have a reason so, that's why I was adding this patch to fix some cases, and later I was going to add a second patch (which depended on this one) to fix the rest of them. The 1st was changing the encoding format and the second would have changed to all-absolute-URIs because there was still a use case which was broken with the some-absolute-some-relative-and-with-different-encoding approach that we had in trunk.

So please, next time, let's talk about this (more), so I don't waste time on patches that are going to become obsolete. Thanks.
Comment 13 Alexander Kojevnikov 2009-04-22 07:57:40 UTC
*** Bug 548128 has been marked as a duplicate of this bug. ***
Comment 14 Alexander Kojevnikov 2009-04-22 08:02:05 UTC
*** Bug 560934 has been marked as a duplicate of this bug. ***