Additional playable extensions
This commit is contained in:
@@ -30,40 +30,38 @@ type ConfigInterface interface {
|
||||
GetRateLimitSleepSecs() int
|
||||
ShouldDeleteRarFiles() bool
|
||||
GetDownloadsEveryMins() int
|
||||
GetPlayableExtensions() []string
|
||||
}
|
||||
|
||||
type ZurgConfig struct {
|
||||
Version string `yaml:"zurg" json:"-"`
|
||||
Token string `yaml:"token" json:"-"`
|
||||
|
||||
Host string `yaml:"host" json:"host"`
|
||||
Port string `yaml:"port" json:"port"`
|
||||
Username string `yaml:"username" json:"username"`
|
||||
Password string `yaml:"password" json:"password"`
|
||||
Proxy string `yaml:"proxy" json:"proxy"`
|
||||
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
|
||||
RefreshEverySecs int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
|
||||
RepairEveryMins int `yaml:"repair_every_mins" json:"repair_every_mins"`
|
||||
DownloadsEveryMins int `yaml:"downloads_every_mins" json:"downloads_every_mins"`
|
||||
|
||||
IgnoreRenames bool `yaml:"ignore_renames" json:"ignore_renames"`
|
||||
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
|
||||
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension" json:"retain_folder_name_extension"`
|
||||
|
||||
CanRepair bool `yaml:"enable_repair" json:"enable_repair"`
|
||||
DeleteRarFiles bool `yaml:"auto_delete_rar_torrents" json:"auto_delete_rar_torrents"`
|
||||
|
||||
ApiTimeoutSecs int `yaml:"api_timeout_secs" json:"api_timeout_secs"`
|
||||
DownloadTimeoutSecs int `yaml:"download_timeout_secs" json:"download_timeout_secs"`
|
||||
DownloadMount bool `yaml:"enable_download_mount" json:"enable_download_mount"`
|
||||
RateLimitSleepSecs int `yaml:"rate_limit_sleep_secs" json:"rate_limit_sleep_secs"`
|
||||
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
|
||||
NetworkBufferSize int `yaml:"network_buffer_size" json:"network_buffer_size"`
|
||||
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
|
||||
VerifyDownloadLink bool `yaml:"verify_download_link" json:"verify_download_link"`
|
||||
ForceIPv6 bool `yaml:"force_ipv6" json:"force_ipv6"`
|
||||
|
||||
OnLibraryUpdate string `yaml:"on_library_update" json:"on_library_update"`
|
||||
ApiTimeoutSecs int `yaml:"api_timeout_secs" json:"api_timeout_secs"`
|
||||
CanRepair bool `yaml:"enable_repair" json:"enable_repair"`
|
||||
DeleteRarFiles bool `yaml:"auto_delete_rar_torrents" json:"auto_delete_rar_torrents"`
|
||||
DownloadMount bool `yaml:"enable_download_mount" json:"enable_download_mount"`
|
||||
DownloadsEveryMins int `yaml:"downloads_every_mins" json:"downloads_every_mins"`
|
||||
DownloadTimeoutSecs int `yaml:"download_timeout_secs" json:"download_timeout_secs"`
|
||||
ForceIPv6 bool `yaml:"force_ipv6" json:"force_ipv6"`
|
||||
Host string `yaml:"host" json:"host"`
|
||||
IgnoreRenames bool `yaml:"ignore_renames" json:"ignore_renames"`
|
||||
NetworkBufferSize int `yaml:"network_buffer_size" json:"network_buffer_size"`
|
||||
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
|
||||
OnLibraryUpdate string `yaml:"on_library_update" json:"on_library_update"`
|
||||
Password string `yaml:"password" json:"password"`
|
||||
PlayableExtensions []string `yaml:"addl_playable_extensions" json:"addl_playable_extensions"`
|
||||
Port string `yaml:"port" json:"port"`
|
||||
Proxy string `yaml:"proxy" json:"proxy"`
|
||||
RateLimitSleepSecs int `yaml:"rate_limit_sleep_secs" json:"rate_limit_sleep_secs"`
|
||||
RefreshEverySecs int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
|
||||
RepairEveryMins int `yaml:"repair_every_mins" json:"repair_every_mins"`
|
||||
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension" json:"retain_folder_name_extension"`
|
||||
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
|
||||
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
|
||||
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
|
||||
Username string `yaml:"username" json:"username"`
|
||||
VerifyDownloadLink bool `yaml:"verify_download_link" json:"verify_download_link"`
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetConfig() ZurgConfig {
|
||||
@@ -202,3 +200,10 @@ func (z *ZurgConfig) GetRateLimitSleepSecs() int {
|
||||
func (z *ZurgConfig) ShouldDeleteRarFiles() bool {
|
||||
return z.DeleteRarFiles
|
||||
}
|
||||
|
||||
func (z *ZurgConfig) GetPlayableExtensions() []string {
|
||||
if len(z.PlayableExtensions) == 0 {
|
||||
return []string{}
|
||||
}
|
||||
return z.PlayableExtensions
|
||||
}
|
||||
|
||||
@@ -319,14 +319,14 @@ func checkArithmeticSequenceInFilenames(files []string) bool {
|
||||
}
|
||||
r := regexp.MustCompile(`\d+`)
|
||||
for _, file := range files {
|
||||
if !utils.IsStreamable(file) {
|
||||
if !utils.IsPlayable(file) {
|
||||
continue
|
||||
}
|
||||
matches := r.FindAllStringIndex(file, -1)
|
||||
for _, match := range matches {
|
||||
numSet := make(map[int]struct{})
|
||||
for _, file := range files {
|
||||
if !utils.IsStreamable(file) {
|
||||
if !utils.IsPlayable(file) {
|
||||
continue
|
||||
}
|
||||
if match[0] >= 0 && match[1] <= len(file) {
|
||||
|
||||
Reference in New Issue
Block a user