Trying to understand the Scanner code

  1. Where can I find the Media, VideoFiles, and Stack class? I couldn’t found them.
  2. For the simple case, I am looking at the Plex Video Files Scanner.py now. I have a question. When I try to change this line:
movie = Media.Movie(name, year)

to

movie = Media.Movie('test', '2020')

I can see the video name will display as ‘test’ for couple second. Then the name will change back to its original file name.

  1. I am also trying to organize a folder of videos into something like a TV show, but I am not quite understand how to do that. I found something in the Plex Series Scanner.py, but I don’t get how it does it. Below is what I found:
                        name, year = VideoFiles.CleanName(show)
                        if len(name) > 0:
                            for ep in range(episode, endEpisode + 1):
                                tv_show = Media.Episode(name, season, ep, '', year)
                                tv_show.display_offset = (ep - episode) * 100 / (endEpisode - episode + 1)
                                tv_show.parts.append(i)
                                mediaList.append(tv_show)

I guess how it works is creating a TV Show object and add an episode into it maybe? Correct me if I am wrong.

Any helps are appreciated. Thanks!