# Trying to understand the Scanner code

**URL:** <https://forums.plex.tv/t/trying-to-understand-the-scanner-code/672775>\
**Category:** Dev/API Corner\
**Created:** [January 1, 2021, 2:08pm UTC](https://forums.plex.tv/t/trying-to-understand-the-scanner-code/672775 "2021-01-01T14:08:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YesterdaY](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/yesterday/32/221899_2.png) [@YesterdaY](https://forums.plex.tv/u/YesterdaY)\
**Post date:** [January 1, 2021, 2:08pm UTC](https://forums.plex.tv/t/trying-to-understand-the-scanner-code/672775/1 "2021-01-01T14:08:25Z")

</div>

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:

```auto
movie = Media.Movie(name, year)

```

to

```auto
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:

```auto
                        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!
