Spaces:
Build error
Build error
Commit
·
818ad36
1
Parent(s):
ec57f9e
fix stream error
Browse files- Instance.py +8 -4
Instance.py
CHANGED
|
@@ -255,17 +255,21 @@ class Instance:
|
|
| 255 |
|
| 256 |
# Extract season and episode information from the cache_path
|
| 257 |
season_part = os.path.basename(os.path.dirname(cache_path)) # Extracts 'Season 1'
|
| 258 |
-
episode_part = os.path.basename(cache_path) # Extracts 'Grand Blue Dreaming - S01E01 - Deep Blue HDTV-
|
| 259 |
|
| 260 |
-
#
|
| 261 |
if title not in tv_store_data:
|
| 262 |
tv_store_data[title] = {}
|
|
|
|
| 263 |
if season_part not in tv_store_data[title]:
|
| 264 |
-
tv_store_data[title][season_part] =
|
| 265 |
-
|
|
|
|
|
|
|
| 266 |
|
| 267 |
with open(TV_STORE_JSON_PATH, 'w') as json_file:
|
| 268 |
json.dump(tv_store_data, json_file, indent=2)
|
|
|
|
| 269 |
print(f'TV store updated with {title}, {season_part}, {episode_part}.')
|
| 270 |
|
| 271 |
|
|
|
|
| 255 |
|
| 256 |
# Extract season and episode information from the cache_path
|
| 257 |
season_part = os.path.basename(os.path.dirname(cache_path)) # Extracts 'Season 1'
|
| 258 |
+
episode_part = os.path.basename(cache_path) # Extracts 'Grand Blue Dreaming - S01E01 - Deep Blue HDTV-720p.mp4'
|
| 259 |
|
| 260 |
+
# Create the structure if not already present
|
| 261 |
if title not in tv_store_data:
|
| 262 |
tv_store_data[title] = {}
|
| 263 |
+
|
| 264 |
if season_part not in tv_store_data[title]:
|
| 265 |
+
tv_store_data[title][season_part] = {}
|
| 266 |
+
|
| 267 |
+
# Assuming episode_part is unique for each episode within a season
|
| 268 |
+
tv_store_data[title][season_part][episode_part] = cache_path
|
| 269 |
|
| 270 |
with open(TV_STORE_JSON_PATH, 'w') as json_file:
|
| 271 |
json.dump(tv_store_data, json_file, indent=2)
|
| 272 |
+
|
| 273 |
print(f'TV store updated with {title}, {season_part}, {episode_part}.')
|
| 274 |
|
| 275 |
|