mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-24 21:43:07 +00:00
Added Time Display
This commit is contained in:
parent
23d5914682
commit
e18211f35e
2 changed files with 11 additions and 9 deletions
|
@ -404,15 +404,6 @@ class Config:
|
|||
util.seperator("Mapping {} Library".format(library.name))
|
||||
logger.info("")
|
||||
movie_map, show_map = self.map_guids(library)
|
||||
|
||||
unmanaged_collections = [col.title for col in library.get_all_collections() if col.title not in collections]
|
||||
if len(unmanaged_collections) > 0:
|
||||
for col in unmanaged_collections:
|
||||
logger.info(col)
|
||||
logger.info("{} Unmanaged Collections".format(len(unmanaged_collections)))
|
||||
else:
|
||||
logger.info("No Unmanaged Collections")
|
||||
|
||||
for c in collections:
|
||||
try:
|
||||
logger.info("")
|
||||
|
|
|
@ -78,9 +78,20 @@ try:
|
|||
if args.run:
|
||||
start(args.config)
|
||||
else:
|
||||
length = 0
|
||||
schedule.every().day.at(args.time).do(start, args.config)
|
||||
while True:
|
||||
schedule.run_pending()
|
||||
current = datetime.datetime.now().strftime("%H:%M")
|
||||
seconds = (datetime.datetime.strptime(args.time, "%H:%M") - datetime.datetime.strptime(current, "%H:%M")).total_seconds()
|
||||
hours = int(seconds // 3600)
|
||||
if hours < 0:
|
||||
hours += 24
|
||||
minutes = int((seconds % 3600) // 60)
|
||||
time_str = "{} Hour{} and ".format(hours, "s" if hours > 1 else "") if hours > 0 else ""
|
||||
time_str += "{} Minute{}".format(minutes, "s" if minutes > 1 else "")
|
||||
|
||||
length = util.print_return(length, "Current Time: {} | {} until the daily run at {}".format(current, time_str, args.time))
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
util.seperator("Exiting Plex Meta Manager")
|
||||
|
|
Loading…
Reference in a new issue