-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update indexes after deleting lines #2
base: master
Are you sure you want to change the base?
Conversation
The function clean_indexes should be called to trigger a re-indexing according to byroot/pysrt#57 .
Move original SRT file to the temp dir if changes were made instead of renaming it in the source dir.
I see. Very useful, thank you. |
Let me know when you think this is ready to be merged |
Any update on this? |
Sorry for the delay. I found another bug, Will update this soon with the fix for that as well. |
No problem, |
@@ -82,6 +84,7 @@ if __name__ == '__main__': | |||
print("Removing: "+str(line)+"\n") | |||
del subs[i] | |||
modified = True | |||
if modified: | |||
move(filename, filename+'.bak') | |||
if modified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if modified | |
if modified: |
move(filename, filename+'.bak') | ||
if modified | ||
subs.clean_indexes() | ||
move(filename, path.join(tempfile.gettempdir(), filename+'.bak'))1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move(filename, path.join(tempfile.gettempdir(), filename+'.bak'))1 | |
move(filename, path.join(tempfile.gettempdir(), filename+'.bak')) |
The function clean_indexes should be called to trigger a re-indexing according to byroot/pysrt#57 .