53 lines
1.4 KiB
Markdown
53 lines
1.4 KiB
Markdown
# fix-subs
|
|
|
|
Some shows will have their subtitles nested in a `Subs/` folder that is within the season itself. This causes some issues
|
|
with Plex as it will not find the subtitles if they are nested. An example of this nested structure is:
|
|
```
|
|
Show Name/
|
|
|- Season 01/
|
|
|- S01E01.mp4
|
|
|- S01E02.mp4
|
|
|- S01E03.mp4
|
|
|- Subs/
|
|
|- S01E01/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
|- S01E02/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
|- S01E03/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
|- Season 02/
|
|
|- S02E01.mp4
|
|
|- S02E02.mp4
|
|
|- S02E03.mp4
|
|
|- Subs/
|
|
|- S02E01/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
|- S02E02/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
|- S02E03/
|
|
|- Subtitle 1.srt
|
|
|- Subtitle 2.srt
|
|
```
|
|
|
|
This short program will go through the folders and grab the subtitles files (.srt) and place them in the appropriate season folder.
|
|
It will also rename the folder correctly (Season xx format). It will then remove the old `Subs/` folder within the season.
|
|
Plex should then be able to search for these subtitle files and load them correctly.
|
|
|
|
## Building / Running
|
|
Compiled with golang 1.19.3 amd64 linux:
|
|
|
|
```
|
|
go build fix-subs.go
|
|
```
|
|
Or run without building
|
|
```
|
|
go run fix-subs.go
|
|
```
|
|
|
|
## TODO
|
|
- Set goroutines to cycle through directories simultaneously |