I'm not really sure what the purpose of load_subscription() is in lib/MusicBrainz/Script/SubscriptionEmails.pm. Can anyone lend any insight?
2013-02-01 03225, 2013
warp
Leftmost: if you look in Entity::ArtistSubscription, you'll see it has an artist_id and an artist property.
2013-02-01 03254, 2013
Leftmost
So it takes the ID and fills in the artist object?
2013-02-01 03255, 2013
warp
Leftmost: $self->c->model('Artist')->load($subscription) in this case will take that artist_id, load the data from the database and assign it to artist.
2013-02-01 03207, 2013
warp
yes, something like that.
2013-02-01 03245, 2013
warp
c->model('Artist')->load refers to the load() method of MusicBrainz::Server::Data::Artist
2013-02-01 03237, 2013
Leftmost
Yeah, I was looking at that too. I just wasn't sure I understood what load_subobjects() was doing and whether that would work for collections, since collections have no similar load() function.
2013-02-01 03219, 2013
warp
I don't think there is currently any entity with a collection_id or something like that, so having a ->load would be a bit pointless.
2013-02-01 03255, 2013
Leftmost
warp, I'm implementing collection subscriptions.
2013-02-01 03229, 2013
warp
ok, so you've created CollectionSubscription.pm ?
2013-02-01 03237, 2013
Leftmost
Yeah.
2013-02-01 03245, 2013
warp
then you probably get to be the one to implement a ->load on Data::Collection as well :)
2013-02-01 03209, 2013
Leftmost
Yep. :)
2013-02-01 03229, 2013
Leftmost
Would load_subobjects() work on Collection since it's a CoreEntity?
2013-02-01 03216, 2013
warp
I don't know, I haven't really touched those parts of the code much.
I've created a CollectionSubscription class and I'm trying to load the collection corresponding to a CollectionSubscription's ID attribute.
2013-02-01 03231, 2013
Leftmost
I tried copypastaing the MusicBrainz::Server::Data::Artist load() method over to Collection, but right now it's telling me that validation failed for 'Collection'.
2013-02-01 03258, 2013
reosarevok
Go go go developing-through-copypasting!
2013-02-01 03205, 2013
MBJenkins
Oliver Charles: Add support for submitting relationship trees
2013-02-01 03220, 2013
reosarevok
(not sarcastic or anything :) )
2013-02-01 03255, 2013
Leftmost
Admittedly, I don't really understand how load_subobjects() works.
2013-02-01 03253, 2013
ocharles
Why do you think you need to load the collection, out of interest?
2013-02-01 03256, 2013
ocharles
Also, paste code
2013-02-01 03224, 2013
Leftmost
To get the collection name for subscription emails.
Now all I need is the ability to display edits for a collection and the ability to create subscriptions and we're good to go. :-P
2013-02-01 03247, 2013
ocharles
nikki: Yea
2013-02-01 03243, 2013
reosarevok
Leftmost: so you already get mails if someone does what to a collection, add/remove releases?
2013-02-01 03257, 2013
Leftmost
reosarevok, modify releases in the collection.
2013-02-01 03213, 2013
reosarevok
Oh, you already get that much? :)
2013-02-01 03217, 2013
reosarevok
Sweet
2013-02-01 03225, 2013
Leftmost
My impression of the previous discussion was that receiving notifications on adding/removing releases wasn't a hot feature right now.
2013-02-01 03247, 2013
reosarevok
Yeah, agreed - that'd be more useful for collaborative collections that we don't yet have
2013-02-01 03209, 2013
Leftmost
Yeah. It's also harder to implement, since subscriptions currently revolve around edits.
2013-02-01 03240, 2013
reosarevok
heh, ok
2013-02-01 03253, 2013
reosarevok
I thought it would be easier, but yeah, guess there's no code to copy for that :)
2013-02-01 03252, 2013
djce joined the channel
2013-02-01 03235, 2013
djce joined the channel
2013-02-01 03257, 2013
adhawkins
Anyone know what ruaok wanted me for yesterday evening?
2013-02-01 03210, 2013
adhawkins
Was it to do with the WS meeting?
2013-02-01 03238, 2013
Freso
adhawkins: I think so.
2013-02-01 03257, 2013
adhawkins
Oh ok. I guess I'm a bit late then :)
2013-02-01 03219, 2013
Freso
Somewhat, yes. :)
2013-02-01 03234, 2013
ocharles
yea, it was for what we ended up blogging about
2013-02-01 03203, 2013
adhawkins
Ok, I'll read the blog entry./
2013-02-01 03214, 2013
adhawkins
I don't think that woudl break my usage (flactag).
2013-02-01 03229, 2013
adhawkins
The lib just parses and packages up whatever is returned in the XML, so shouldn't affect the lib either.
2013-02-01 03257, 2013
adhawkins
One of the things on my todo list is to optimise flactag. I think it's making more queries than is strictly necessary. And each query might be asking for data that it doesn't use.
2013-02-01 03202, 2013
ocharles
seeing as we don't show elements that are empty, it shouldn't break any libraries
2013-02-01 03209, 2013
ocharles
cause you can't really assume the presence of elements
2013-02-01 03258, 2013
adhawkins
Yep
2013-02-01 03235, 2013
andreypopp joined the channel
2013-02-01 03220, 2013
Leftmost
I don't totally understand the structure of classes and I'm not sure how much of it is Moosey. If a package has `with WhateverRole', can I take one of the methods from the role, override it to do an auth check, and just call the parent method?
nikki: yes. we don't have a process for merging stuff into beta for people who don't have commit access, and github makes it hard to see shippits.
2013-02-01 03217, 2013
warp
nikki: I'll do that one now.
2013-02-01 03244, 2013
djce joined the channel
2013-02-01 03247, 2013
Freso
warp: Do 10 too? :)
2013-02-01 03230, 2013
warp
ok
2013-02-01 03249, 2013
voiceinsideyou joined the channel
2013-02-01 03238, 2013
Freso
It was the first pull request after the decision to change to GH PRs for now, and possibly the simplest one to date as well... yet it hasn't gotten merged yet. We really need a better way to see shipit-ready PRs. :)
I do really like that github auto-closes those even if I didn't merge them through their interface.
2013-02-01 03206, 2013
Freso
I also like that GitHub allows to easily rm branches that have been merged.
2013-02-01 03209, 2013
ocharles
Starting from Perl 5.10.1 (well, 5.10.0, but it didn't work right), you can say
2013-02-01 03210, 2013
ocharles
use feature "switch";
2013-02-01 03215, 2013
ocharles
that's my documentation find of the day
2013-02-01 03222, 2013
Freso
ocharles: \o/
2013-02-01 03231, 2013
warp
I've read that.
2013-02-01 03247, 2013
ocharles
(I had set use 5.10.0 at the top of my file and it wasn't working)
2013-02-01 03255, 2013
warp
oh, haha
2013-02-01 03226, 2013
ocharles
Writing Perl these days feels like i'm programming under an army instructor who's constantly trying to make me quit and give up
2013-02-01 03227, 2013
Freso
ocharles: DROP AND GIVE ME 20!
2013-02-01 03212, 2013
ocharles cries
2013-02-01 03250, 2013
Leftmost
ocharles, I'm feeling a bit like that too.
2013-02-01 03259, 2013
nikki
warp: did you set the tickets to in beta testing?
2013-02-01 03235, 2013
Freso
Ugh. I'm not sure I added a link to the ticket for my PR, come to think of it. D:
2013-02-01 03239, 2013
Freso is bad peeps
2013-02-01 03207, 2013
Freso
Oh, no, I did!
2013-02-01 03211, 2013
Freso is good peeps :D
2013-02-01 03246, 2013
Leftmost
ocharles, if I have "with 'MusicBrainz::Server::Controller::Account::SubscriptionsRole';", can I take the add method, override it in the class, and call the SubscriptionsRole version?
Leftmost: i don't quite get what you mean by 'take' and the 'override in the class'
2013-02-01 03228, 2013
Leftmost
Sorry, not communicating well today.
2013-02-01 03255, 2013
Leftmost
So SubscriptionsRole has an add() method for /account/subscriptions/${whatever}/add. I have a class that implements SubscriptionsRole, but I want to have add() do a check to make sure the person can subscribe to the collection, then call the add() from SubscriptionsRole.
2013-02-01 03214, 2013
Freso
Leftmost: If nothing else, couldn't you do something like ```sub _parent_add { MusicBrainz::Server::Controller::Account::SubscriptionsRole::add }``` and then call self._parent_add ?