huh, and L154 has the public list, which sorts only by musicbrainz_collate(name) and not id
I wonder why the subscribed one has also the sort by id
zas
hmmm, so we can't ensure the same order in Picard, this id isn't returned by webservice
kepstin-laptop
zas: I was mistaken, the id is only used in a fairly obscure place. the main collections list only uses the name
ianmcorvidae
as mentioned, it's not actually sorted by that where you're likely to care, the line kepstin quoted was for subscriptions
zas
ah ok
so when two collections have same name, they are randomly sorted
ianmcorvidae
now, when the names are the same it's just sorted by whatever order it comes out of the DB, so that bit you won't be able to replicate
kepstin-laptop
presumably the webservice will return them in the order they came out of the db
ianmcorvidae
but then, naming two collections the same makes them nearly useless anyway :P
kepstin-laptop
so if you use a stable sort, it should be ok
nikki
we could just make it so people can't do stupid things like that :P
ianmcorvidae
we could let them suffer with their own mistake if they do, is more what I was suggesting :P
Freso goes to rename all his collections "cllection"
zas
:)
kepstin-laptop is annoyed that he can't get xpaths to work in firefox :/
well, if two or more collections can have the same name, we have to handle it ;) the best thing to do is to not allow it from start, stupidity solved ;)
ianmcorvidae proposes order by musicbrainz_collate(name), random() then :P
kepstin-laptop
to be specific, that I can't get xpaths to work on the xml returned from an xmlhttpresponse
hmm.
zas
order by random() is even better if you ask me, CHAOS !
musicbrainz_collate() in python is ... ?
ianmcorvidae
unsure, there's probably an ICU library you could replicate it with
zas
yes, that's what i fear... dependency in sight
kepstin-laptop
zas: that'll be a lot of fun ;) that function's written in C or C++, installed as a postgres plugin, and uses ICU to make collation strings with various options set
zas: if you can get a reasonable case-insensitive unicode sort, that's probably good enough.
kepstin-laptop is annoyed that the glibc C library's collation functions for the english unicode locales handle japanese really, really poorly
but just to sort collection menu it looks a bit overkill
kepstin-laptop
i.e. worse than sorting by unicode codepoint :/
I'm sure we could find some other places to use ICU once we have it :)
zas
yes prolly
kepstin-laptop notes that getting PyICU isn't really an issue on linux, most folks already have ICU and PyICU is easy to install - it's only an issue with the bundled installers for windows/os x :/
ianmcorvidae
it seems to be fairly rare that things are an issue on linux, so that's not exactly unpredictable :P
zas
;)
bobcat_
Hmm. Im still struggling. I want to add the external links to what I have so far: select artist.name,area.name from artist join area on (artist.area=area.id) where artist.name ~ 'Orchestra';
chirlu`
bobcat_: Links for the artist or the area?
bobcat_
chirlu`: for the artist
chirlu`: official homepage, twitter etc
chirlu`
Then you need to join the "url" table via "l_artist_url".
bobcat_
chirlu`: this is my first day with psql
chirlu`
… JOIN l_artist_url ON artist.id = l_artist_url.entity0 JOIN url ON l_artist_url.entity1 = url.id
or something like that.
(untested)
kepstin-laptop notes that the unicode collation algorithm itself isn't that big, it has a few tricky spots, but not that bad. But it does require a fairly large number of tables, including locale specific ones
bobcat_
chirlu`: Thank you!
chirlu`
bobcat_: Oh, BTW, this will only return results that have at least one URL (and an area, for that matter).
If that’s not what you want, you will need to look into outer joins (LEFT JOIN etc.).
bobcat_
chirlu`: This almost works: select artist.name,area.name,url from artist join area on (artist.area=area.id) join l_artist_url on (artist.id=l_artist_url.entity0) join url on (l_artist_url.entity1=url.id) where artist.name ~ 'Orchestra';
chirlu`: but im getting each artist,name,area.name,url in a separate line when there are multiple urls