Closed GoogleCodeExporter closed 9 years ago
Problem stems from the fact that RatingChanged is a field of DBUserSettings
when it really should be a parameter sent along with the event/delegate call
notifying listeners of a DB update.
One approach for a fix would be to have some DatabaseTable level list of
changed properties that the subclass is required to populate. Then the
DatabaseManager when dispatching events could look at this list to provide info
as a parameter to the listening classes.
Original comment by conrad.john
on 22 Jun 2011 at 2:27
Okay made the changes in r1323. Please take a look at the code changes. Trakt
plugin should still compile properly against Moving Pictures code, but to get
proper notifications you will have to make a few changes. Specifically you will
need to begin listening to the ObjectUpdatedEx event instead of ObjectUpdated.
This will give you the DBUserMovieSettings object as normal but also a metadata
object that has info about which fields have changed. The old RatingChanged
field in DBUserMovieSettings is now deprecated.
Please note the extension methods in TableUpdateInfoExtensions. Making use of
these, your event handler should be able to work something like this:
private void DatabaseManager_ObjectUpdated(DatabaseTable obj, TableUpdateInfo
updateInfo) {
if (obj.GetType() != typeof(DBUserMovieSettings))
return;
if(updateInfo.RatingChanged()) {
// do stuff
}
}
Original comment by conrad.john
on 30 Jul 2011 at 7:51
Original issue reported on code.google.com by
onenotto...@gmail.com
on 22 Jun 2011 at 2:16