MCPcopy
hub / github.com/ChineseSubFinder/ChineseSubFinder / IsWantedVideoExtDef

Function IsWantedVideoExtDef

pkg/util.go:238–260  ·  view source on GitHub ↗

IsWantedVideoExtDef 后缀名是否符合规则

(fileName string)

Source from the content-addressed store, hash-verified

236
237// IsWantedVideoExtDef 后缀名是否符合规则
238func 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
262func GetEpisodeKeyName(season, eps int, zerofill ...bool) string {
263

Callers 2

MatchedVideoFileFunction · 0.92
SeriesAllEpsAndSubtitlesFunction · 0.92

Calls 1

GetFunction · 0.92

Tested by

no test coverage detected