mmmmmtasty / SportScanner

Scanner and Metadata Agent for Plex that uses sportdb
101 stars 31 forks source link

Agent/Scanner not picking anything up. #19

Open LFFPicard opened 7 years ago

LFFPicard commented 7 years ago

Hi,

I have had this issue trying to use a couple custom scanners but would like to stick to your scanner/agent so hoping you can help as well. I am trying to add Formula 1 to Plex. The folder structure is as follows: E:\Formula 1\Season 1978\Formula 1 - s1978e01 - Argentine Grand Prix.extension (Extension is anything form .avi to .mkv) The seasons are from 1978 all the way up to 2010.

If I add the library as a tv show using the Plex Series Scanner and Personal Media Shows Agent then it scans the files and adds them with no meta data or anything, but they add.

If I choose any other combination including the Sports Scanner/Agent then it just instantly refreshes and comes up with "The library has no content yet. Click here to add content to the library."

I am using the latest Plex on Windows10. Any ideas?

pmendes commented 7 years ago

I suspect this issue has to do with an error reading the file size. I got this from my log file: Dec 10, 2016 11:27:48.672 [0x7fb8e7133800] ERROR - Error in Python: Running scanner: Traceback (most recent call last): File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Scanners/Series/SportScanner.py", line 81, in Scan file_contents = os.read(fd, size) OverflowError: signed integer is greater than maximum

It suggests that the file size is a number larger than can fit in a signed integer. I am no python programmer (I speak C), but this looks like the problem is with the variable "size" which should be able to fit large numbers. One of my files is 8819367827 bytes (8.2 GiB), this may be the issue.

pmendes commented 7 years ago

Ok, I've figured out the problem is not the "size" variable, actually it is "file_contents". Essentially this section of the code is supposed to read some file called .SportsScanner, but it is actually reading the actual video files. I suspect the problem now is on line 74 in the regex for this .SportsScanner file.

I bet the main author of the software could fix this quickly if s/he is actually reading this...

pmendes commented 7 years ago

As a temporary fix, I have commented out lines 78 to 109 and now it recognizes all my files. (The section commented out is the part that deals with the SportScanner.txt file which I don't need, since I am using the preferred path structure, i.e. using Formula 1/Season folders).

For me this works, but it would be nice if author could fix the bug

redxon commented 7 years ago

Did you do something else, other than commenting out those lines? Because I tried it the same way and it did not work; the scanner still does not recognise any media in the sports folder. My structure is the same as the OP has it.

LFFPicard commented 7 years ago

I have also commented out those lines as far as I can tell and the files now add via the SportScanner/Agent but still no Meta Data. So each folder adds as a different "Show" as it where and within that it just labels them up as Episode 1, Episode 2 etc etc. No images or anything.

tbh this is exactly how Plex video scanner would handle it if I used that instead anyway.

redxon commented 7 years ago

I changed to standard agent and scanner to just add the files now. Then I manually matched them with the SportScanner to Formula 1. I now have the show artwork and the description, but the episodes inside the season are still named Episode 1, Episode 2 etc.

Does SportScanner not name the episodes accordingly to The Sports DB?

mmmmmtasty commented 7 years ago

pmendes, could you send me the logs for a failed scan? You are saying that you do not have a SportScanner.txt file created, but I can't see how this code would be executing without that file existing?

                    filename = re.sub(r'(.*\\).*?$',r'\1SportScanner.txt',clean_files[file])
                    print "SS: FileName: {0}".format(filename)

                    if os.path.isfile(filename):
                        size = os.path.getsize(filename)
                        fd = os.open(filename, os.O_RDONLY)
                        file_contents = os.read(fd, size)

It looks like you are not using a supported naming scheme though - of which there is only one. Adding support for alternative naming schemes like your own is not so hard but I do not actively maintain this project any more. PRs welcome or I will look into this if I get a bit more time and information.

pmendes commented 7 years ago

Sorry this was sometime ago, I don't have the logs anymore. I had the SportScanner.txt file, however I am using the preferred path. As I commented out lines 78 to 109 I no longer need to have SportScanner.txt. The code now works for me as long as I keep the path structure that your code expects. With those lines in the code always failed, even if I used the suggested path structure.

Sorry, but I also don't have much time to re-generate the problem to get the log files. I understand you don't have time to fix this. From my point of view the code since I fixed the code for me, I am ok with keeping things as they are.

shovelhed commented 7 years ago

I see the same issue. Would love to help out if I can.

jbalcorn commented 2 years ago

I submitted PR #36 to fix this issue.

jbalcorn commented 2 years ago

@mmmmmtasty I believe this issue is resolved.