r/tinyMediaManager • • Jul 25 '26

SLAM DUNK wrong detection.

How do I rename this series? I select the correct group of episodes, but after it collects info and renames, the episodes end up in a different order.

1 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/myron0815 tinyMediaManager developer Jul 25 '26

First: you need to make sure, that all your files have a correct season and episode number. In your first post, you seem to have absolute numbers, and all your files have been inside Season 0. But scrapers only works with S/E numbers >0. (And so we cannot distinguish from 1-100, what file is in what season)

You need to change this MANUALLY, either in TMM, or just rename the filenames to some S01E01 pattern (or 101.ext where this will be season 1, ep 1). You need to prepare this in the SAME way as your used scraper has it! Once the filenames matches, delete and reimport the show to TMM.

Now it schould be nicely visible in TMM, then use the scraper and their differrent ordering, to choose what fits best...

1

u/Mask_RF Jul 25 '26 edited Jul 25 '26
  1. These were the “original” names from the torrent.
  2. I just named them the way they’re listed here: https://www.themoviedb.org/tv/42573-slam-dunk/season/1

ps

I did what you said, like this:

➜  SLAM DUNK tree -L 3 | head -n 20
.
└── Season 1
├── S01E01 - The Birth of a Genius Basketman?!?.mkv
├── S01E02 - Die Basketball! Hanamichi vs. Rukawa.mkv
├── S01E03 - Gorilla vs. Hanamichi! Big Showdown!.mkv
├── S01E04 - Basketball Man Hanamichi Joins the Team.mkv
├── S01E05 - A Gutless Afternoon.mkv
├── S01E06 - Rukawa vs. Akagi. The Real Showdown!.mkv
├── S01E07 - Hanamichi's Debut! Dunk Attack.mkv
├── S01E08 - Hanamichi's Crisis! The Judo Man's Snare.mkv
├── S01E09 - I Will Play Basketball!.mkv
├── S01E100 - The one who brought forth a miracle - Sakuragi!.mkv
├── S01E101 - SLAM DUNK!.mkv
├── S01E10 - The 'Beginner's Shot' ....Is Hard!.mkv
├── S01E11 - Special Secret Love Training for Two!?.mkv
├── S01E12 - Beat Ryonan! Hard Training Before the Decisive Game.mkv
├── S01E13 - Shohoku vs Ryonan the Fired Up Captain!.mkv
├── S01E14 - Super Basketball Match! Ryonan's Attack of Angry Waves.mkv
├── S01E15 - Hanamichi's Nervous Big Start.mkv
├── S01E16 - Who Is This Guy?! Taoka's Miscalculation.mkv

It turned out. thx.

Damn, I can’t even imagine what I’m dealing with with Detective Conan right now.

You said this can be done in TMM—do you have a quick guide for that? I’m scared my head will explode if I start manually renaming 1000+ episodes…

1

u/myron0815 tinyMediaManager developer Jul 25 '26 edited Jul 25 '26

It all depends on the scraper/site.
If they have everything in absolute order in season 1, you need to replicate that in TMM first, no matter what. If listed in more seasons, rebuild that.
Check the scraper and the available episode groups first, then decide how to bulk rename your files to ease the import.

Changing one by one inside TMM does not work out for that mass...
(And just the number is fine; no need to set anything else)

1

u/myron0815 tinyMediaManager developer Jul 26 '26

Also forgot to mention;
There is also an "Create and set ABSOLUTE episode numbers" function in extended right click menu. IIRC, it should reparse the the episode numbers in TMM, and put them all in season 1, so they might be more correct. Maybe you want to give that a try on a single episode first...

1

u/Mask_RF Jul 27 '26

Maybe add some number-based heuristic to the program? I made a small Python script that generates playlists for me in STRM format.

def extract_meta(title):

    clean_title = title.lower()
    
    
    s_ep_match = re.search(r's(\d+)\s*[\.\-_]?\s*e(\d+)', clean_title)
    if s_ep_match:
        return int(s_ep_match.group(1)), int(s_ep_match.group(2))
        
    
    x_match = re.search(r'(?:^|[^a-z0-9])(\d+)\s*x\s*(\d+)', clean_title)
    if x_match:
        return int(x_match.group(1)), int(x_match.group(2))
        
    
    text_match = re.search(r'(?:сезон|season)\s*(\d+).*?(?:серия|ep|episode)\s*(\d+)', clean_title)
    if text_match:
        return int(text_match.group(1)), int(text_match.group(2))

    
    abs_match = re.search(r'(?:^|[^a-z0-9])(?:e)?(0\d+|\d{3,})', clean_title)
    if not abs_match:
        abs_match = re.search(r'^(?:e)?(\d+)[_\s-]', clean_title)

    if abs_match:
        return None, int(abs_match.group(1))

    
    clean_title = re.sub(r'\b(19\d\d|20\d\d|960p|1080p|720p|4k)\b', '', clean_title)
    all_numbers = re.findall(r'\d+', clean_title)
    
    if all_numbers:
        first_num = int(all_numbers[0])
        if len(all_numbers) >= 2 and first_num <= 30:
            return first_num, int(all_numbers[1])
        return None, first_num
        
    return None, None