Skip to content
Snippets Groups Projects
Commit 9f9c557d authored by Christian Pointner's avatar Christian Pointner
Browse files

Merge branch 'master' into stable

parents 25b6bfba f1c2a398
No related branches found
No related tags found
No related merge requests found
...@@ -14,22 +14,31 @@ class Command(NoArgsCommand): ...@@ -14,22 +14,31 @@ class Command(NoArgsCommand):
cache_dir = getattr(settings, 'AUTOMATION_CACHE_DIR', 'cache') cache_dir = getattr(settings, 'AUTOMATION_CACHE_DIR', 'cache')
cached_shows = join(cache_dir, 'shows.json') cached_shows = join(cache_dir, 'shows.json')
with open(cached_shows) as shows_json: with open(cached_shows) as shows_json:
shows = json.loads(shows_json.read())['shows'] shows = json.loads(shows_json.read())
automation_ids = [] rd_ids = {}
for show in shows: for show in shows['shows']:
automation_ids.append(show['id']) rd_ids[show['id']] = show
automation_ids.sort() for show in shows['multi-shows']:
rd_ids[show['id']] = show
automation_ids2 = [] pv_ids = []
for programslot in ProgramSlot.objects.filter(automation_id__isnull=False): for programslot in ProgramSlot.objects.filter(automation_id__isnull=False):
automation_ids2.append(int(programslot.automation_id)) pv_ids.append(int(programslot.automation_id))
automation_ids2.sort()
for automation_id in sorted(rd_ids.iterkeys()):
for automation_id in automation_ids: if rd_ids[automation_id]['type'] == 's':
if automation_id not in automation_ids2: continue
print '+', automation_id
multi_id = -1
for automation_id in automation_ids2: if 'multi' in rd_ids[automation_id]:
if automation_id not in automation_ids: multi_id = rd_ids[automation_id]['multi']['id']
if automation_id not in pv_ids and multi_id not in pv_ids:
if multi_id < 0:
print '+ %d' % (automation_id)
else:
print '+ %d (%d)' % (automation_id, multi_id)
for automation_id in sorted(pv_ids):
if automation_id not in rd_ids:
print '-', automation_id print '-', automation_id
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment