Skip to content

[BUG] Subtitle files with 3 chars language code are not imported #4

Description

@juandbc

Describe the bug
Subtitle files with 3 characters code for languages (spa, eng, etc) are skipped and deleted

To Reproduce
Steps to reproduce the behavior:

  1. Copy a movie or show with subtitles
  2. Click on the 'import movie/show' option in the respective module
  3. Open the file explorer, and only the video file is imported
  4. See error in logs

Expected behavior
When the videos are imported, it should import the subtitles as well. For example:

#Before
➜  Atonement (2007) [tmdbid-4347] ll                         
total 3,1G
-rw-r--r-- 2 - - 3,1G feb 19 21:01 'Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.mp4'
-rw-r--r-- 1 - -  68K feb 23 17:12 'Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.spa.srt'
#After 
-rw-r--r--. 2 - - 3,1G feb 19 21:01 'Atonement (2007) - IMPORTED.mp4'
-rw-r--r-- 1 - -  68K feb 23 17:12 'Atonement (2007) - IMPORTED.spa.srt'

Screenshots
If applicable, add screenshots to help explain your problem.

Server Logs
If applicable, add logs to help explain your problem.

2026-02-27 14:34:31,228 - [41d04a1c48f44b8e99f59bcc48993da7] INFO - media_manager.torrent.utils - get_files_for_import(): Importing files from directory /data/movies/.Atonement (2007) [tmdbid-4347]
2026-02-27 14:34:31,229 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - list_files_recursively(): Found 3 entries via glob
2026-02-27 14:34:31,229 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - list_files_recursively(): Returning 3 files after filtering
2026-02-27 14:34:31,229 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - get_files_for_import(): Found 3 files downloaded by the torrent
2026-02-27 14:34:31,229 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - extract_archives(): File: /data/movies/.Atonement (2007) [tmdbid-4347]/movie.nfo, Size: 3150 bytes, Type: (None, None)
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - extract_archives(): File: /data/movies/.Atonement (2007) [tmdbid-4347]/Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.spa.srt, Size: 68883 bytes, Type: ('text/plain', None)
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - extract_archives(): File: /data/movies/.Atonement (2007) [tmdbid-4347]/Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.mp4, Size: 3323190043 bytes, Type: ('video/mp4', None)
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - list_files_recursively(): Found 3 entries via glob
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - list_files_recursively(): Returning 3 files after filtering
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - get_files_for_import(): File is a subtitle, it will be imported: /data/movies/.Atonement (2007) [tmdbid-4347]/Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.spa.srt
2026-02-27 14:34:31,230 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.torrent.utils - get_files_for_import(): File is a video, it will be imported: /data/movies/.Atonement (2007) [tmdbid-4347]/Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.mp4
2026-02-27 14:34:31,231 - [41d04a1c48f44b8e99f59bcc48993da7] INFO - media_manager.torrent.utils - get_files_for_import(): Found 3 files (1 video files, 1 subtitle files) for further processing.
2026-02-27 14:34:31,240 - [41d04a1c48f44b8e99f59bcc48993da7] DEBUG - media_manager.movies - get_movie_root_path(): Movie Atonement without special characters: Atonement
2026-02-27 14:34:31,242 - [41d04a1c48f44b8e99f59bcc48993da7] WARNING - media_manager.movies - import_movie(): Subtitle file Atonement (2007) 1080p BDRip AAC x264 (multisubs)-tomcat12.spa.srt does not match expected format, can't extract language code, skipping.

Version
v1.12.3 or latest

docker-compose.yaml

services:
  mediamanager:
    image: quay.io/maxdorninger/mediamanager:latest
    ports:
      - "8000:8000"
    environment:
      - CONFIG_DIR=/app/config
      - TZ=America/Bogota
      - MEDIAMANAGER_LOG_LEVEL=DEBUG
    volumes:
      # Mount your actual media directories here - these paths should match your config.toml
      - /mnt/media/Shows/:/data/Shows/
      - /mnt/media/Movies/:/data/Movies/
      - /mnt/media/Downloads/:/downloads/
      # Config folder for application configuration
      - ./config/mediamanager:/app/config/
      # Image folder
      - /mnt/media/Images/:/data/images/
    depends_on:
      db:
        condition: service_healthy
  db:
    image: postgres:17
    restart: unless-stopped
    volumes:
      - ./config/postgres:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
      interval: 10s
      timeout: 5s
      retries: 5
    environment:
      POSTGRES_USER: MediaManager
      POSTGRES_DB: MediaManager
      POSTGRES_PASSWORD: MediaManager
  flaresolverr:
    image: ghcr.io/flaresolverr/flaresolverr:latest
    environment:
      - LOG_LEVEL=info
    ports:
      - 8191:8191
    restart: unless-stopped
  jackett:
    image: lscr.io/linuxserver/jackett:latest
    container_name: jackett
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Bogota
      - AUTO_UPDATE=true #optional      
    volumes:
      - ./config/jackett/data:/config
    ports:
      - 9117:9117
    restart: unless-stopped
    depends_on:
      flaresolverr:
        condition: service_started
  transmission:
    image: lscr.io/linuxserver/transmission:latest
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=002 
      - TZ=America/Bogota
      - USER=admin
      - PASS=admin
    volumes:
      - ./config/transmission/data:/config
      - /mnt/media/Downloads/:/downloads #optional
    ports:
      - 9091:9091
      - 51413:51413
      - 51413:51413/udp
    restart: unless-stopped

config.toml

# MediaManager Example Configuration File
# This file contains all available configuration options for MediaManager
# Documentation: https://maxdorninger.github.io/MediaManager/introduction.html
#
# This is an example configuration file that gets copied to your config folder
# on first boot. You should modify the values below to match your setup.

[misc]
# it's very likely that you need to change this for MediaManager to work
frontend_url = "http://localhost:8000" # note the lack of a trailing slash
cors_urls = ["http://localhost:8000"] # note the lack of a trailing slash

image_directory = "/data/images"
tv_directory = "/data/Shows"
movie_directory = "/data/Movies"
torrent_directory = "/downloads" # this is where MediaManager will search for the downloaded torrents and usenet files

# you probaly don't need to change this
development = false

# Custom Media Libraries
# These paths should match your volume mounts in docker-compose.yaml
# Example: if you mount "./movies:/media/movies" then use path = "/media/movies/subdirectory"
# [[misc.tv_libraries]]
# name = "Live Action"
# path = "/data/tv/live-action"  # Change this to match your actual TV shows location

# [[misc.movie_libraries]]
# name = "Documentary"
# path = "/data/movies/documentary"  # Change this to match your actual movies location

[database]
host = "db"
port = 5432
user = "MediaManager"
password = "MediaManager"
dbname = "MediaManager"

[auth]
email_password_resets = false # if true, you also need to set up SMTP (notifications.smtp_config)

token_secret = "" # generate a random string with "openssl rand -hex 32", e.g. here https://www.cryptool.org/en/cto/openssl/
session_lifetime = 86400  # this is how long you will be logged in after loggin in, in seconds

# Admin users: Users who register with these email addresses will automatically become administrators
# If no users exist in the database, a default admin user will be created with the first email in this list
admin_emails = ["admin@example.com", "admin2@example.com"]

# OpenID Connect settings
[auth.openid_connect]
enabled = false
client_id = ""
client_secret = ""
configuration_endpoint = "https://openid.example.com/.well-known/openid-configuration"
name = "OpenID"

[notifications]
# SMTP settings for email notifications and email password resets
[notifications.smtp_config]
smtp_host = "smtp.example.com"
smtp_port = 587
smtp_user = "admin"
smtp_password = "admin"
from_email = "mediamanager@example.com"
use_tls = true

# Email notification settings
[notifications.email_notifications]
enabled = false
emails = ["admin@example.com", "admin2@example.com"]  # List of email addresses to send notifications to

# Gotify notification settings
[notifications.gotify]
enabled = false
api_key = ""
url = "https://gotify.example.com"

# Ntfy notification settings
[notifications.ntfy]
enabled = false
url = "https://ntfy.sh/your-topic"

# Pushover notification settings
[notifications.pushover]
enabled = false
api_key = ""
user = ""

[torrents]
# qBittorrent settings
[torrents.qbittorrent]
enabled = false
host = "http://qbittorrent"
port = 8080
username = "admin"
password = "adminadmin"

# Transmission settings
[torrents.transmission]
enabled = true
username = "admin"
password = "admin"
https_enabled = false
host = "transmission"
port = 9091
path = "/transmission/rpc" # RPC request path target, usually "/transmission/rpc"

# SABnzbd settings
[torrents.sabnzbd]
enabled = false
host = "http://localhost"
port = 8080
api_key = ""
base_path = "/api"

[indexers]
# Prowlarr settings
[indexers.prowlarr]
enabled = false
url = "http://localhost:9696"
api_key = ""
timeout_seconds = 60

# Jackett settings
[indexers.jackett]
enabled = true
url = "http://jackett:9117"
api_key = "oyl31gii0a4v9gtps2yfo7xxkja7hdhn"
indexers = ["apachetorrent","cinecalidad","divxtotal","dontorrent","filmeshdtorrent","hdrtorrent","redetorrent","wolfmax4k","animetosho","limetorrents","uztracker","nyaasi","torrent9","yts","bitsearch","zktorrent","extratorrent-st","therarbg","rutracker-ru","internetarchive","elitetorrent-wf","thepiratebay","moviesdvdr","torrentqq","torrentsome","isohunt2","frozenlayer","kickasstorrents-to","52bt","eztv","torrenttip","bitru","torrentdownloads","torrentdownload","acgrip","bigfangroup","1337x","rutor"]
timeout_seconds = 120

# Title-based scoring rules
[[indexers.title_scoring_rules]]
name = "prefer_webdl"
keywords = ["WEB-DL", "WEBDL"]
score_modifier = 100
negate = false

[[indexers.title_scoring_rules]]
name = "prefer_h265"
keywords = ["h265", "hevc", "x265", "h.265", "x.265", "remux"]
score_modifier = 100
negate = false

[[indexers.title_scoring_rules]]
name = "avoid_unsupported_tech"
keywords = ["DV", "10bit"]
score_modifier = -1000
negate = false

[[indexers.title_scoring_rules]]
name = "avoid_cam"
keywords = ["cam", "camrip", "bdscr", "ddc", "dvdscreener","dvdscr", "hdcam", "hdtc", "hdts", "scr", "screener","telesync", "ts", "webscreener", "tc", "telecine", "tvrip"]
score_modifier = -10000
negate = false

# Indexer flag-based scoring rules
[[indexers.indexer_flag_scoring_rules]]
name = "prefer_freeleech"
flags = ["freeleech", "freeleech75"]
score_modifier = 100
negate = false

[[indexers.indexer_flag_scoring_rules]]
name = "reject_nuked"
flags = ["nuked"]
score_modifier = -10000
negate = false

# Scoring rulesets
[[indexers.scoring_rule_sets]]
name = "default"
libraries = ["ALL_TV", "ALL_MOVIES"]
rule_names = ["prefer_h265", "refer_webdl", "avoid_cam", "avoid_unsupported_tech", "reject_nuked", "prefer_freeleech"]

# its very unlikely that you need to change this
[metadata]
[metadata.tmdb]
tmdb_relay_url = "https://metadata-relay.dorninger.co/tmdb"
primary_languages = ["en", "es"]
default_language = "en"

[metadata.tvdb]
tvdb_relay_url = "https://metadata-relay.dorninger.co/tvdb"
  • I understand, that without logs and/or screenshots and a detailed description of the problem, it is very hard to fix bugs.
  • I have checked the documentation for help.
  • I have searched the issues for similar issues and found none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions