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

Crash on indexing files whose filename starts with the year. #28

Open
joshkerr opened this issue Apr 14, 2018 · 0 comments
Open

Crash on indexing files whose filename starts with the year. #28

joshkerr opened this issue Apr 14, 2018 · 0 comments

Comments

@joshkerr
Copy link

joshkerr commented Apr 14, 2018

When Fetch matches files to metadata it can crash if your movie has the date at the beginning of the filename. Create a folder and movie with the following title and Downpour will throw an error:

1984.1984.720p.BluRay.H264.AAC.mp4

The error is happening in Downpour.swift line 151:

} else if year != nil {
                let endIndex = rawString.index(rawString.range(of: year!)!.lowerBound, offsetBy: -1)
                return rawString[rawString.startIndex...endIndex].cleanedString
            }

I think the index is going out of range due to the offset, but I could be wrong. Its been a longtime since I've written code.

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

1 participant