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

call clean_indexes after opening a file? #53

Closed
felagund opened this issue May 26, 2014 · 1 comment
Closed

call clean_indexes after opening a file? #53

felagund opened this issue May 26, 2014 · 1 comment

Comments

@felagund
Copy link
Contributor

The following is a perfectly valid SRT file (at least anything that handles them will open it just fine), let's call it subs.srt:

3
00:08:17,317 --> 00:08:19,328
It is life or death, James.

The following happens

a = pysrt.open('subs.srt')
a[0].index
>>>> 3
a.clean_indexes()
a[0].index
>>>> 1

Should not clean_indexes() be called after opening the subtitles by default? There is also the issue that index after calling clean_indexes() starts at 1 and python lists start at 0, but I do not think it would be wise to do anything about it.

@byroot
Copy link
Owner

byroot commented May 26, 2014

Indexes usually mean nothing, most players don't care about them, and they can be in totally random orders, or have duplicates, nobody will say anything.

I have no idea what was the original intent for it...

But it's still data, so it shouldn't change implicitly. I want pysrt.open(path).write() not to change the file, except duplicate blank lines maybe.

So no, no automatic call to clean_indexes().

@byroot byroot closed this as completed May 26, 2014
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

No branches or pull requests

2 participants