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

Update indexes after deleting lines #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hashangayasri
Copy link

The function clean_indexes should be called to trigger a re-indexing according to byroot/pysrt#57 .

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.
@FraMecca
Copy link
Owner

FraMecca commented Oct 3, 2020

I see. Very useful, thank you.

@FraMecca
Copy link
Owner

FraMecca commented Oct 3, 2020

Let me know when you think this is ready to be merged

@FraMecca
Copy link
Owner

FraMecca commented Dec 2, 2020

Any update on this?

@hashangayasri
Copy link
Author

Sorry for the delay. I found another bug, Will update this soon with the fix for that as well.

@FraMecca
Copy link
Owner

No problem,
take your time

@@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if modified
if modified:

move(filename, filename+'.bak')
if modified
subs.clean_indexes()
move(filename, path.join(tempfile.gettempdir(), filename+'.bak'))1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
move(filename, path.join(tempfile.gettempdir(), filename+'.bak'))1
move(filename, path.join(tempfile.gettempdir(), filename+'.bak'))

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.

3 participants