Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support duplicate timestamps by merging into single timestamp #1179

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

tylerdak
Copy link
Contributor

Hey there!

I've noticed that ytdl-sub throws an error when duplicate timestamps are found in its check for ascending order. Makes total sense for albums where you only have one track at a time, but I've found user-submitted timestamps for DJ sets sometimes feature these. For example, the top timestamp comment under this video.

This pull request adds support for these duplicate timestamps by combining them into one with a delimiter in the timestamp title to split them up. I can change the delimiter if preferred, but it seemed like a good obvious one.

To find duplicates, I added a comparison to the last added Timestamp. If they match, the last added title is appended with the delimiter and the duplicate timestamp title. The duplicate's Timestamp object is ignored so only a single Chapter is created for that timecode.

Hoping we can get this implemented! Thanks!

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.79%. Comparing base (0ebcfb6) to head (d07b735).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1179   +/-   ##
=======================================
  Coverage   91.79%   91.79%           
=======================================
  Files         113      113           
  Lines        7445     7449    +4     
=======================================
+ Hits         6834     6838    +4     
  Misses        611      611           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmbannon jmbannon merged commit bb2bc49 into jmbannon:master Feb 21, 2025
34 checks passed
@jmbannon
Copy link
Owner

Thanks @tylerdak for the concise and tested change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants