From 536da598bd274645e406637e829e2a6ffc6a13f5 Mon Sep 17 00:00:00 2001 From: blacktwin Date: Thu, 21 Apr 2022 14:43:08 -0400 Subject: [PATCH] adding json and json file checking for files in script's root. --- fun/playlist_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fun/playlist_manager.py b/fun/playlist_manager.py index d13c8be..e085881 100644 --- a/fun/playlist_manager.py +++ b/fun/playlist_manager.py @@ -110,6 +110,7 @@ from __future__ import unicode_literals from builtins import str import sys import os +import json import random import logging import requests @@ -182,6 +183,8 @@ filters_lst = list(set([y.key for x in sections if x.type != 'photo' for y in x. admin_playlist_lst = [x for x in plex.playlists()] today = datetime.datetime.now().date() weeknum = datetime.date(today.year, today.month, today.day).isocalendar()[1] +json_check = sorted([f for f in os.listdir('.') if os.path.isfile(f) and f.endswith(".json")], + key=os.path.getmtime) def actions():