taylorbobaylor/TrailerDownloader

I get the following error on the newst version 1.1.5

Closed this issue · 21 comments

UHAXM1 commented

fail: Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher[8]
Failed to invoke hub method 'GetAllMoviesInfo'.
System.ArgumentNullException: Value cannot be null. (Parameter 'input')
at System.Text.RegularExpressions.ThrowHelper.ThrowArgumentNullException(ExceptionArgument arg)
at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)
at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, String replacement)
at TrailerDownloader.SignalRHubs.MovieHub.GetMovieFromDirectory(String movieDirectory) in /Users/taylorchristian/repos/TrailerDownloader/TrailerDownloader/SignalRHubs/MovieHub.cs:line 135
at TrailerDownloader.SignalRHubs.MovieHub.GetAllMoviesInfo() in /Users/taylorchristian/repos/TrailerDownloader/TrailerDownloader/SignalRHubs/MovieHub.cs:line 57
at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher1.ExecuteMethod(ObjectMethodExecutor methodExecutor, Hub hub, Object[] arguments) at Microsoft.AspNetCore.SignalR.Internal.DefaultHubDispatcher1.g__ExecuteInvocation|18_0(DefaultHubDispatcher1 dispatcher, ObjectMethodExecutor methodExecutor, THub hub, Object[] arguments, AsyncServiceScope scope, IHubActivator1 hubActivator, HubConnectionContext connection, HubMethodInvocationMessage hubMethodInvocationMessage, Boolean isStreamCall)

UHAXM1 commented

Ok I found the issue.
Some of my movie directories had sub directories like "Subs" and "Subtitles", they only included the srt files and nothing else, this was the cause of the issue, I found the issue around line 107 of the MovieHub.cs file, I changed it to read the following.

        foreach (var subDirectory in subDirectories)
        {
            if (Directory.GetDirectories(subDirectory).Length <= 0) continue;
            if (!subDirectory.Contains("Subs")) continue;
            if (!subDirectory.Contains("Subtitles")) continue;

            _movieDirectories.Add(subDirectory);
            hasSubdirectories = true;
        }

I found this in the code I downloaded (version 1.1.5 souce zip), however when I look at the file in the master branch it is diffrent, the master branch code is not the same as the code in the zip file. So I am unsure as to what I should do next,
I have compiled my changes and tested, and it fixes the issue.
Taylorbobatlow can you please advise.

Hey @UHAXM1! Thanks for looking into it. I must've forgotten to update the release with the latest.
If you'd like to make a PR with your changes I'll take a look 😊

UHAXM1 commented

Here ya go. I just published from master branch and updated here

UHAXM1 commented

It should be up to date with the latest PR I did
#30

UHAXM1 commented
UHAXM1 commented

Ahhhh I see what you're saying. Thanks. I made a new release. GitHub automatically puts the source code.zip when you make the release so I just had to make a new one.
https://github.com/taylorbobaylor/TrailerDownloader/releases/tag/v1.1.6

Ahhhh I see what you're saying. Thanks. I made a new release. GitHub automatically puts the source code.zip when you make the release so I just had to make a new one. https://github.com/taylorbobaylor/TrailerDownloader/releases/tag/v1.1.6

I'm not sure if you've updated the TrailerDownloaderWindows.zip as the error still occurs.

UHAXM1 commented

@UHAXM1, @killmark-prog Sorry I'm not understanding the problem... The latest version is working for me with no issues. And the source code zip on latest release is exact same as master branch.....

Master branch:
image

Source code.zip:
image

Tried the most recent release

image

@killmark-prog It looks like something is wrong with one of your directories. Is the app crashing when this happens or what is the UI doing?

Apologies, your correct.

From what I can see, if I have a folder with a trailer already in it, but their is no corresponding movie file then I get that error message and it will crash and stop looking for movie files.

Deleting orphan trailers solves the issue, though I can't click download all missing trailers and would have to manually select the films without trailers.

UHAXM1 commented

@UHAXM1 Thanks for the explanation! I made a new branch and replaced it with what you uploaded. You can use this branch to now make your changes and then make a PR into master branch.
https://github.com/taylorbobaylor/TrailerDownloader/tree/UHAX

UHAXM1 commented

@UHAXM1 I merged your changes into master and created a release here. Can you please test?
@killmark-prog Can you see if this fixes your issue as well?

UHAXM1 commented

Awesome, I will close this one out. Still working on the major refactor and will update the release once I have that finished 😊