Tracks are not numerically sorted when sorting by album [$5]

Bug #1346678 reported by Sam Hewitt
344
This bug affects 19 people
Affects Status Importance Assigned to Milestone
Noise
Fix Released
High
Gero.Bare

Bug Description

When sorting by album the album's tracks are out-of order –they're not sorted numerically. This is also a problem when sorting by track as a whole.

Affects Noise 0.3.0+r1641+pkg78~ubuntu0.3.1

Related branches

Revision history for this message
Sam Hewitt (snwh) wrote :
Revision history for this message
Shawn McTear (syst3mfailur3) wrote :

Some songs are also incorrectly placed between songs from another album.

summary: - Tracks are not numerically sorted when sorting by album
+ Tracks are not numerically sorted when sorting by album [$5]
Revision history for this message
Isaac Parris (dexcasul) wrote :

Nevermind that last bit. I see it now.

Isaac Parris (dexcasul)
Changed in noise:
status: New → Confirmed
status: Confirmed → New
Revision history for this message
Isaac Parris (dexcasul) wrote :

On my Luna installation it seems to work just fine. Is this an issue with the newer Freya verison?

Changed back to New for now. I'll have to check it out on Freya first.

Sam Hewitt (snwh)
description: updated
Cody Garver (codygarver)
Changed in noise:
milestone: none → freya-beta2
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Shawn McTear (syst3mfailur3) wrote :
Revision history for this message
Cameron Norman (cameronnemo) wrote :

Can confirm, I am running noise, version 0.3.0+r1641+pkg78~ubuntu0.3.1 on debian Sid in the GNOME environment. It looks like what is happening is that every pair of songs is getting flopped. I will try to explain in a video or something...

Revision history for this message
Piotr Marcinkowski (md5sum) wrote :

Hallo all,

I think i have found root cause. The problem is calling `foreach` on HashTable. It seems that `foreach` does not iterate througth HashTable properly. I checked it by pasting the followed code into `reorder_request` member function (right after quicksort) in FastView.vala file.

Code:
        stderr.printf("\n\nresort\n");
        table.foreach ((key, val) => {
            stderr.printf("%s\n", ((Media)val).get_display_title ());
        });

        stderr.printf("\n\nresort2\n");
        for(int i = 0; i < table.size(); ++i) {
            stderr.printf("%s\n", ((Media)table.get (i)).get_display_title ());
        }

Please find the result attached.
Calling foreach on HashTables was introduced in rev 1601.

information type: Public → Public Security
Changed in noise:
assignee: nobody → PerfectCarl (name-is-carl)
status: Confirmed → In Progress
Cody Garver (codygarver)
Changed in noise:
status: In Progress → Fix Committed
assignee: PerfectCarl (name-is-carl) → Gero.bare (gero-bare)
Revision history for this message
Li Chong (l-chong-v) wrote :

It's solved. Thanks!

Revision history for this message
zaporcezar (zaporcezar) wrote :

Sorting songs take way to much time... and does not work correctly

Revision history for this message
Gero.Bare (gero-bare) wrote :

@zaporcezar

Please be more specific.
It is a current build? It's a distribution package?

What doesn't work properly? Track numbers, albums, artist?

About the speed. The last patch it should not affect the speed. The speed issue was present after an update? Can you list the version? Also the Number of songs you are dealing with.

In the case of speed you might refer to this bug also https://bugs.launchpad.net/noise/+bug/1350450

Revision history for this message
Jonathan Lumb (jonolumb) wrote :

I am running noise_0.3.0+r1698+pkg85~ubuntu0.3.1_i386.deb and this still isn't working for me. Tracks still don't display in the right order.

Any ideas?

Revision history for this message
Gero.Bare (gero-bare) wrote :

Sorry guys I missed something.

I never considered the condition you are filtering your library with a search, the logic was left untouched and that trigger the problem. I was to blame here.

Now it should handle both conditions, sort the whole library and sort the results of a filtered library.

Sorry.

@Cody Garver
Please update this again, sorry for the trouble.

Changed in noise:
status: Fix Committed → In Progress
Cody Garver (codygarver)
Changed in noise:
status: In Progress → Fix Committed
Revision history for this message
Jonathan Lumb (jonolumb) wrote : Re: [Bug 1346678] Re: Tracks are not numerically sorted when sorting by album [$5]

No problem - I was indeed filtering the library with a search. Once this is
committed and I can see it works, I'll make sure the bounty is paid out.
Thanks for your hard efforts to improve such a brilliant music app!

On 13 October 2014 10:33, Gero.bare <email address hidden> wrote:

> Sorry guys I missed something.
>
> I never considered the condition you are filtering your library with a
> search, the logic was left untouched and that trigger the problem. I was
> to blame here.
>
> Now it should handle both conditions, sort the whole library and sort
> the results of a filtered library.
>
> Sorry.
>
> @Cody Garver
> Please update this again, sorry for the trouble.
>
> ** Changed in: noise
> Status: Fix Committed => In Progress
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1346678
>
> Title:
> Tracks are not numerically sorted when sorting by album [$5]
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/noise/+bug/1346678/+subscriptions
>

--
Jonathan Lumb
Translator & Conference Interpreter
Shanghai, 上海
+8618621796552 | <email address hidden>

Revision history for this message
Gero.Bare (gero-bare) wrote :

No, thanks to you. Your input was very helpful, it was thanks to you that I was able to identify the last part of the puzzle. The previous report left me with more questions than answers.

Also it was very helpful the fact that your input was while I had the things fresh, otherwise I probably couldn't fix this. I'm not very familiar with the code base yet. I just started some days ago to read the code.

Changed in noise:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.