huh, and L154 has the public list, which sorts only by musicbrainz_collate(name) and not id
2014-03-21 08057, 2014
kepstin-laptop
I wonder why the subscribed one has also the sort by id
2014-03-21 08005, 2014
zas
hmmm, so we can't ensure the same order in Picard, this id isn't returned by webservice
2014-03-21 08039, 2014
kepstin-laptop
zas: I was mistaken, the id is only used in a fairly obscure place. the main collections list only uses the name
2014-03-21 08044, 2014
ianmcorvidae
as mentioned, it's not actually sorted by that where you're likely to care, the line kepstin quoted was for subscriptions
2014-03-21 08055, 2014
zas
ah ok
2014-03-21 08021, 2014
zas
so when two collections have same name, they are randomly sorted
2014-03-21 08021, 2014
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
2014-03-21 08039, 2014
kepstin-laptop
presumably the webservice will return them in the order they came out of the db
2014-03-21 08041, 2014
ianmcorvidae
but then, naming two collections the same makes them nearly useless anyway :P
2014-03-21 08047, 2014
kepstin-laptop
so if you use a stable sort, it should be ok
2014-03-21 08038, 2014
nikki
we could just make it so people can't do stupid things like that :P
2014-03-21 08055, 2014
ianmcorvidae
we could let them suffer with their own mistake if they do, is more what I was suggesting :P
2014-03-21 08016, 2014
Freso goes to rename all his collections "cllection"
2014-03-21 08023, 2014
zas
:)
2014-03-21 08008, 2014
kepstin-laptop is annoyed that he can't get xpaths to work in firefox :/
2014-03-21 08030, 2014
zas
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 ;)
2014-03-21 08009, 2014
ianmcorvidae proposes order by musicbrainz_collate(name), random() then :P
2014-03-21 08034, 2014
kepstin-laptop
to be specific, that I can't get xpaths to work on the xml returned from an xmlhttpresponse
2014-03-21 08036, 2014
kepstin-laptop
hmm.
2014-03-21 08056, 2014
zas
order by random() is even better if you ask me, CHAOS !
2014-03-21 08025, 2014
zas
musicbrainz_collate() in python is ... ?
2014-03-21 08043, 2014
ianmcorvidae
unsure, there's probably an ICU library you could replicate it with
2014-03-21 08005, 2014
zas
yes, that's what i fear... dependency in sight
2014-03-21 08009, 2014
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
2014-03-21 08029, 2014
kepstin-laptop
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
2014-03-21 08058, 2014
zas
but just to sort collection menu it looks a bit overkill
2014-03-21 08004, 2014
kepstin-laptop
i.e. worse than sorting by unicode codepoint :/
2014-03-21 08032, 2014
kepstin-laptop
I'm sure we could find some other places to use ICU once we have it :)
2014-03-21 08045, 2014
zas
yes prolly
2014-03-21 08049, 2014
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 :/
2014-03-21 08017, 2014
ianmcorvidae
it seems to be fairly rare that things are an issue on linux, so that's not exactly unpredictable :P
2014-03-21 08024, 2014
zas
;)
2014-03-21 08000, 2014
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';
2014-03-21 08025, 2014
chirlu`
bobcat_: Links for the artist or the area?
2014-03-21 08046, 2014
bobcat_
chirlu`: for the artist
2014-03-21 08007, 2014
bobcat_
chirlu`: official homepage, twitter etc
2014-03-21 08007, 2014
chirlu`
Then you need to join the "url" table via "l_artist_url".
2014-03-21 08038, 2014
bobcat_
chirlu`: this is my first day with psql
2014-03-21 08009, 2014
chirlu`
… JOIN l_artist_url ON artist.id = l_artist_url.entity0 JOIN url ON l_artist_url.entity1 = url.id
2014-03-21 08013, 2014
chirlu`
or something like that.
2014-03-21 08026, 2014
chirlu`
(untested)
2014-03-21 08057, 2014
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
2014-03-21 08016, 2014
bobcat_
chirlu`: Thank you!
2014-03-21 08014, 2014
chirlu`
bobcat_: Oh, BTW, this will only return results that have at least one URL (and an area, for that matter).
2014-03-21 08013, 2014
chirlu`
If that’s not what you want, you will need to look into outer joins (LEFT JOIN etc.).
2014-03-21 08036, 2014
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';
2014-03-21 08052, 2014
bobcat_
chirlu`: but im getting each artist,name,area.name,url in a separate line when there are multiple urls