putdotio / putio-kodi

Official Put.io Kodi addon
GNU General Public License v3.0
11 stars 2 forks source link

Subtitle filenames have language code appended after .srt file extension #22

Open joelpurra opened 5 days ago

joelpurra commented 5 days ago

@berkanteber wrote (https://github.com/putdotio/putio-kodi/pull/17#issuecomment-2406127284):

3.1.0 has just been approved (for Nexus and above). This should improve subtitle language identification.

The subtitle filename now (https://github.com/putdotio/putio-kodi/releases/tag/v3.1.0) has the language code/shortname appended, but it is appended after the .srt file extension. This makes "srt" part of the subtitle "name" as parsed by Kodi. In general, it also breaks filename-based file type detection

Example:

berkanteber commented 5 days ago

In general, it also breaks filename-based file type detection

What do you mean by this?

joelpurra commented 5 days ago

In general, it also breaks filename-based file type detection

What do you mean by this?

I mean that it changes the filename's file extension. Video Name.srt - eng (incorrect extension) has a different file extension type from Video Name - eng.srt (SubRip Text (SRT) subtitle file; correct).

- Video Name.srt - eng
+ Video Name - eng.srt

May or may not matter to Kodi, because Kodi gets "told" it's a subtitle file (https://github.com/putdotio/putio-kodi/blob/v3.1.0/main.py#L135), but I certainly consider it a bug.

tree ~/.kodi/temp/plugin.video.putio
~/.kodi/temp/plugin.video.putio
└── subtitles
    └── 0000000000
        ├── abc_de
        │   └── Video Name.srt - eng
        ...
berkanteber commented 5 days ago

Got it.

We have 3 types of subtitles:

What are your thought on when we should append language code?

I think: