Skip to content

Commit

Permalink
Fix: complete remove chapters (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
xjasonlyu committed Dec 14, 2023
1 parent 476600e commit 21ea5e7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
26 changes: 0 additions & 26 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,32 +323,6 @@ def update(self, metadata, media, lang, force=False):
if m.runtime:
metadata.duration = m.runtime * 60 * 1000 # millisecond

# # Chapters
# metadata.chapters.clear()
# chapter_min_duration = 10 * 60 * 1000 # 10 minutes
# chapter_gen_interval = 5 * 60 * 1000 # 5 minutes
# # only generate chapters for media with single file
# durations = [int(p.duration) for p in utils.extra_media_parts(media)
# if int(p.duration) > 0]
# if Prefs[KEY_ENABLE_CHAPTERS]:
# if not durations:
# Log.Warn('Chapter: no valid duration for media: {id}'
# .format(id=metadata.id))
# elif len(durations) > 1:
# Log.Warn('Chapter: ignore multi-part media: {id}'
# .format(id=metadata.id))
# elif durations[0] < chapter_min_duration:
# Log.Warn('Chapter: ignore short-duration media: {id}'
# .format(id=metadata.id))
# else:
# duration = durations[0]
# for i, offset in enumerate(range(0, duration, chapter_gen_interval)):
# start, end = offset, offset + chapter_gen_interval
# chapter = metadata.chapters.new()
# chapter.title = 'Chapter {i}'.format(i=(i + 1))
# chapter.start_time_offset = start
# chapter.end_time_offset = end if end < duration else duration

# Clear Ratings
metadata.rating = 0.0
metadata.audience_rating = 0.0
Expand Down
6 changes: 0 additions & 6 deletions Contents/DefaultPrefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
"type": "bool",
"default": "false"
},
{
"id": "enable_chapters",
"label": "Enable chapters",
"type": "bool",
"default": "true"
},
{
"id": "enable_directors",
"label": "Enable directors",
Expand Down

0 comments on commit 21ea5e7

Please sign in to comment.