@@ -1343,6 +1343,7 @@ def printProgrammes(fh):
1343
1343
else :
1344
1344
fh .write ("Movie (" + programs [p ]["movie_year" ] + ")" )
1345
1345
fh .write ("</sub-title>\n " )
1346
+
1346
1347
if "description" in programs [p ] and programs [p ]["description" ] is not None :
1347
1348
fh .write ("\t \t <desc lang=\" " + lang + "\" >" )
1348
1349
tmp = enc (programs [p ]["description" ]) + " "
@@ -1359,21 +1360,76 @@ def printProgrammes(fh):
1359
1360
if "originalAirDate" in programs [p ]:
1360
1361
origdate = enc (convDateLocal (programs [p ]["originalAirDate" ]))
1361
1362
finaldate = datetime .datetime .strptime (origdate , "%Y%m%d" ).strftime ('%B %d, %Y' )
1362
- date = "Originally Aired: " + finaldate
1363
+ date = "First aired: " + finaldate
1364
+ if "movie_year" in programs [p ]:
1365
+ date = "Released: " + programs [p ]["movie_year" ]
1366
+ if "rating" in programs [p ]:
1367
+ ratings = enc (programs [p ]["rating" ]) + bullet
1368
+ if "new" in schedule [station ][s ]:
1369
+ new = "NEW" + bullet
1370
+ origdate = startTime
1371
+ finaldate = datetime .datetime .strptime (origdate , "%Y%m%d%H%M%S" ).strftime ('%B %d, %Y' )
1372
+ date = "First aired: " + finaldate
1373
+ if "live" in schedule [station ][s ]:
1374
+ live = "LIVE" + bullet
1375
+ origdate = startTime
1376
+ finaldate = datetime .datetime .strptime (origdate , "%Y%m%d%H%M%S" ).strftime ('%B %d, %Y' )
1377
+ date = "First aired: " + finaldate
1378
+ if "quality" in schedule [station ][s ]:
1379
+ hd = "HD" + bullet
1380
+ if "cc" in schedule [station ][s ]:
1381
+ cc = "CC" + bullet
1382
+ if "credits" in programs [p ]:
1383
+ sortThing1 = str (p )
1384
+ sortThing2 = "credits"
1385
+ cast = "Cast: "
1386
+ castlist = ""
1387
+ prev = None
1388
+ for g in sorted (programs [p ]["credits" ], cmp = sortThings ):
1389
+ if prev is None :
1390
+ castlist = enc (g )
1391
+ prev = g
1392
+ else :
1393
+ castlist = castlist + ", " + enc (g )
1394
+ cast = cast + castlist + bullet
1395
+ tmp = tmp + live + new + ratings + hd + cc + cast + date
1396
+ tmp = tmp + end
1397
+ fh .write (tmp )
1398
+ else :
1399
+ fh .write ("\t \t <desc lang=\" " + lang + "\" >" )
1400
+ tmp = ""
1401
+ end = "</desc>\n "
1402
+ if "-X" in options :
1403
+ ratings = ""
1404
+ date = ""
1405
+ new = ""
1406
+ live = ""
1407
+ hd = ""
1408
+ cc = ""
1409
+ cast = ""
1410
+ bullet = u" \u2022 "
1411
+ if "originalAirDate" in programs [p ]:
1412
+ origdate = enc (convDateLocal (programs [p ]["originalAirDate" ]))
1413
+ finaldate = datetime .datetime .strptime (origdate , "%Y%m%d" ).strftime ('%B %d, %Y' )
1414
+ date = "First aired: " + finaldate
1363
1415
if "movie_year" in programs [p ]:
1364
1416
date = "Released: " + programs [p ]["movie_year" ]
1365
1417
if "rating" in programs [p ]:
1366
- ratings = bullet + enc (programs [p ]["rating" ])
1418
+ ratings = enc (programs [p ]["rating" ]) + bullet
1367
1419
if "new" in schedule [station ][s ]:
1368
- new = "NEW"
1369
- date = ""
1420
+ new = "NEW" + bullet
1421
+ origdate = startTime
1422
+ finaldate = datetime .datetime .strptime (origdate , "%Y%m%d%H%M%S" ).strftime ('%B %d, %Y' )
1423
+ date = "First aired: " + finaldate
1370
1424
if "live" in schedule [station ][s ]:
1371
- live = "LIVE"
1372
- date = ""
1425
+ live = "LIVE" + bullet
1426
+ origdate = startTime
1427
+ finaldate = datetime .datetime .strptime (origdate , "%Y%m%d%H%M%S" ).strftime ('%B %d, %Y' )
1428
+ date = "First aired: " + finaldate
1373
1429
if "quality" in schedule [station ][s ]:
1374
- hd = bullet + "HD"
1430
+ hd = "HD" + bullet
1375
1431
if "cc" in schedule [station ][s ]:
1376
- cc = bullet + "CC"
1432
+ cc = "CC" + bullet
1377
1433
if "credits" in programs [p ]:
1378
1434
sortThing1 = str (p )
1379
1435
sortThing2 = "credits"
@@ -1386,8 +1442,8 @@ def printProgrammes(fh):
1386
1442
prev = g
1387
1443
else :
1388
1444
castlist = castlist + ", " + enc (g )
1389
- cast = bullet + cast + castlist
1390
- tmp = tmp + live + new + date + ratings + hd + cc + cast
1445
+ cast = cast + castlist + bullet
1446
+ tmp = tmp + live + new + ratings + hd + cc + cast + date
1391
1447
tmp = tmp + end
1392
1448
fh .write (tmp )
1393
1449
0 commit comments