# Sort columns

**URL:** <https://community.metabrainz.org/t/sort-columns/388528>\
**Category:** MusicBrainz\
**Tags:** userscripts\
**Created:** [July 1, 2018, 9:56am UTC](https://community.metabrainz.org/t/sort-columns/388528 "2018-07-01T09:56:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiske\_Tisja](https://community.metabrainz.org/user_avatar/community.metabrainz.org/tiske_tisja/32/63405_2.png) [@Tiske\_Tisja](https://community.metabrainz.org/u/Tiske_Tisja)\
**Post date:** [July 1, 2018, 9:56am UTC](https://community.metabrainz.org/t/sort-columns/388528/1 "2018-07-01T09:56:48Z")

</div>

I have read there is a script to sort columns, where can I find that and how do I use it?

---

<div class="post-metadata">

**Author:** ![Freso](https://community.metabrainz.org/user_avatar/community.metabrainz.org/freso/32/25_2.png) [@Freso](https://community.metabrainz.org/u/Freso)\
**Post date:** [July 1, 2018, 2:58pm UTC](https://community.metabrainz.org/t/sort-columns/388528/2 "2018-07-01T14:58:43Z")

</div>

I believe you refer to one of @loujin’s creations. If you search for “Make table columns sortable” on this page, you should find it:

> **[loujine/musicbrainz-scripts](https://github.com/loujine/musicbrainz-scripts)**
>
> Contribute to musicbrainz-scripts development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![Tiske\_Tisja](https://community.metabrainz.org/user_avatar/community.metabrainz.org/tiske_tisja/32/63405_2.png) [@Tiske\_Tisja](https://community.metabrainz.org/u/Tiske_Tisja)\
**Post date:** [July 2, 2018, 8:19am UTC](https://community.metabrainz.org/t/sort-columns/388528/3 "2018-07-02T08:19:06Z")

</div>

> [@Freso](#):
>
> Make table columns sortable

Thank you for your reply. If I click on the install button I get a losts of code. Dont know what to do with that 🙂

---

<div class="post-metadata">

**Author:** ![jesus2099](https://community.metabrainz.org/user_avatar/community.metabrainz.org/jesus2099/32/36_2.png) [@jesus2099](https://community.metabrainz.org/u/jesus2099)\
**Post date:** [July 2, 2018, 9:15am UTC](https://community.metabrainz.org/t/sort-columns/388528/4 "2018-07-02T09:15:45Z")

</div>

> [@Tiske\_Tisja](#):
>
> Dont know what to do with that 🙂

You need an add‐on to your internet browser in order to be able to install and use user scripts like this.  
[https://musicbrainz.org/doc/Guides/Userscripts](https://musicbrainz.org/doc/Guides/Userscripts)

---

<div class="post-metadata">

**Author:** ![loujin](https://community.metabrainz.org/user_avatar/community.metabrainz.org/loujin/32/126_2.png) [@loujin](https://community.metabrainz.org/u/loujin)\
**Post date:** [July 2, 2018, 10:51am UTC](https://community.metabrainz.org/t/sort-columns/388528/5 "2018-07-02T10:51:12Z")

</div>

> [@Tiske\_Tisja](#):
>
> how do I use it?

[Here](https://bytebucket.org/loujine/musicbrainz-scripts/wiki/sortablecolumns.png)’s a screenshot to show you how it should look like if the installation worked. Note that the script is very basic and works only on certain pages of the site, not all of them.

---

<div class="post-metadata">

**Author:** ![Tiske\_Tisja](https://community.metabrainz.org/user_avatar/community.metabrainz.org/tiske_tisja/32/63405_2.png) [@Tiske\_Tisja](https://community.metabrainz.org/u/Tiske_Tisja)\
**Post date:** [July 2, 2018, 11:28am UTC](https://community.metabrainz.org/t/sort-columns/388528/6 "2018-07-02T11:28:24Z")

</div>

Thank you all for your information. Guess I’m to stupid to do it myself, so I have to ask someone at home. Maybe they can help. I just think… such a beautiful database… gees is must be possible to sort columns.

Thanks all

---

<div class="post-metadata">

**Author:** ![alex\_s7](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@alex\_s7](https://community.metabrainz.org/u/alex_s7)\
**Post date:** [April 10, 2020, 6:47pm UTC](https://community.metabrainz.org/t/sort-columns/388528/7 "2020-04-10T18:47:00Z")

</div>

Reviving an old topic: great script, generally works, but I have encountered one strange case when neither a default sort order nor the script works right.

Test page: [Overture “Tannhäuser und der Sängerkrieg auf Wartburg, WWV 70: Ouvertüre” - MusicBrainz](https://musicbrainz.org/work/1cba82ba-a6f3-3590-a0c1-b9e742fa742d)

By default the sort order appears to be by the date in ascending order, than without the date. But some recordings with assigned date appears at the bottom of the page.

If the @loujin 's script is activated, it is possible to sort by the date in ascending / descending order, but some recordings where the dates are set are still not sorted, they appear as a separate block.

What is so special with those several recordings that they are not sorted?

---

<div class="post-metadata">

**Author:** ![Kid\_Devine](https://community.metabrainz.org/user_avatar/community.metabrainz.org/kid_devine/32/17561_2.png) [@Kid\_Devine](https://community.metabrainz.org/u/Kid_Devine)\
**Post date:** [April 10, 2020, 11:59pm UTC](https://community.metabrainz.org/t/sort-columns/388528/8 "2020-04-10T23:59:55Z")

</div>

It appears that those recordings are being sorted to the bottom because they are linked to more than one work. I’m not sure if this is intentional or a display bug, @reosarevok.

---

<div class="post-metadata">

**Author:** ![alex\_s7](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@alex\_s7](https://community.metabrainz.org/u/alex_s7)\
**Post date:** [April 11, 2020, 3:11pm UTC](https://community.metabrainz.org/t/sort-columns/388528/9 "2020-04-11T15:11:52Z")

</div>

Ticket for default sort order:

> <https://tickets.metabrainz.org/browse/MBS-10756>

A fix for a broken sort order in @loujin 's script is [available in this fork](https://github.com/serdioa/musicbrainz-scripts). I have sent a pull request to @loujin to integrate the fix in the script.

---

<div class="post-metadata">

**Author:** ![loujin](https://community.metabrainz.org/user_avatar/community.metabrainz.org/loujin/32/126_2.png) [@loujin](https://community.metabrainz.org/u/loujin)\
**Post date:** [April 13, 2020, 3:40pm UTC](https://community.metabrainz.org/t/sort-columns/388528/10 "2020-04-13T15:40:55Z")

</div>

> [@alex\_s7](#):
>
> A fix for a broken sort order in @loujin 's script

Applied in version 2020.4.13, thanks for the fix.  
I also fixed the sort-by-recording-duration at the same time

---

<div class="post-metadata">

**Author:** ![alex\_s7](https://community.metabrainz.org/letter_avatar_proxy/v4/letter/a/e79b87/32.png) [@alex\_s7](https://community.metabrainz.org/u/alex_s7)\
**Post date:** [April 13, 2020, 6:43pm UTC](https://community.metabrainz.org/t/sort-columns/388528/11 "2020-04-13T18:43:32Z")

</div>

Works like a charm for duration as well when manually installed.  
The “install” button on your GitHub page still points to the old version though.
