ChandimaPrabath commited on
Commit
818ad36
·
1 Parent(s): ec57f9e

fix stream error

Browse files
Files changed (1) hide show
  1. 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-1080p.mkv'
259
 
260
- # Organize the data by title, season, and episode
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
- tv_store_data[title][season_part].append(episode_part)
 
 
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