IsWantedVideoExtDef 后缀名是否符合规则
(fileName string)
| 236 | |
| 237 | // IsWantedVideoExtDef 后缀名是否符合规则 |
| 238 | func IsWantedVideoExtDef(fileName string) bool { |
| 239 | |
| 240 | if len(_wantedExtMap) < 1 { |
| 241 | _defExtMap[common.VideoExtMp4] = common.VideoExtMp4 |
| 242 | _defExtMap[common.VideoExtMkv] = common.VideoExtMkv |
| 243 | _defExtMap[common.VideoExtRmvb] = common.VideoExtRmvb |
| 244 | _defExtMap[common.VideoExtIso] = common.VideoExtIso |
| 245 | _defExtMap[common.VideoExtM2ts] = common.VideoExtM2ts |
| 246 | |
| 247 | _wantedExtMap[common.VideoExtMp4] = common.VideoExtMp4 |
| 248 | _wantedExtMap[common.VideoExtMkv] = common.VideoExtMkv |
| 249 | _wantedExtMap[common.VideoExtRmvb] = common.VideoExtRmvb |
| 250 | _wantedExtMap[common.VideoExtIso] = common.VideoExtIso |
| 251 | _wantedExtMap[common.VideoExtM2ts] = common.VideoExtM2ts |
| 252 | |
| 253 | for _, videoExt := range settings.Get().AdvancedSettings.CustomVideoExts { |
| 254 | _wantedExtMap[videoExt] = videoExt |
| 255 | } |
| 256 | } |
| 257 | fileExt := strings.ToLower(filepath.Ext(fileName)) |
| 258 | _, bFound := _wantedExtMap[fileExt] |
| 259 | return bFound |
| 260 | } |
| 261 | |
| 262 | func GetEpisodeKeyName(season, eps int, zerofill ...bool) string { |
| 263 |
no test coverage detected