Closed smarquard closed 7 years ago
At least 2 code errors:
In "galicaster/utils/ical.py"
def get_updated_events(old_events, new_events):
out = list()
for old_event in old_events:
for new_event in new_events:
if (old_event['UID'] == new_event['UID'] and
old_event['DTSTART'].dt.replace(tzinfo=None) != new_event['DTSTART'].dt.replace(tzinfo=None)):
out.append(old_event)
return out
This check is not sufficient, because the start date/time might be the same, but the end date/time may have changed. Also other attributes (like title / presenter) could have changed.
Then later in handle_ical in the same file, the indentation is wrong for this code block:
for event in update_events:
logger and logger.info('Updating MP with UID {0} from ical'.format(event['UID']))
mp = repo.get(event['UID'])
scheduler.update_timer(mp)
so it's only executed if there are deleted events.
And then there is another bug in that the mediapackage in the repo is not updated with the new details.
I think the final fix for this is to change in get_updated_events:
out.append(old_event)
to
out.append(new_event)
and then in handle_ical, add create_mp(repo, event) like this:
for event in update_events:
logger and logger.info('Updating MP with UID {0} from ical'.format(event['UID']))
create_mp(repo, event)
mp = repo.get(event['UID'])
scheduler.update_timer(mp)
@dpeite will there be a fix for this soon?
I'm working on this, tomorrow will be finished.
Not finished yet, I have a little problem when I update a series in opencast.
This bug is fixed, you can edit a scheduled recording in opencast and galicaster changes the event to the new values. I close this issue. thank you @smarquard for the report.
Adding new events works ok, and deleting events works ok.