Refactor file type functions

This commit is contained in:
Deluan
2022-12-23 11:32:39 -05:00
committed by Deluan Quintão
parent 9ec349dce0
commit 8c1cd9c273
10 changed files with 75 additions and 98 deletions
+2 -2
View File
@@ -95,11 +95,11 @@ func loadDir(ctx context.Context, dirPath string) ([]string, *dirStats, error) {
stats.ModTime = fileInfo.ModTime()
}
switch {
case utils.IsAudioFile(entry.Name()):
case model.IsAudioFile(entry.Name()):
stats.AudioFilesCount++
case model.IsValidPlaylist(entry.Name()):
stats.HasPlaylist = true
case utils.IsImageFile(entry.Name()):
case model.IsImageFile(entry.Name()):
stats.Images = append(stats.Images, entry.Name())
if fileInfo.ModTime().After(stats.ImagesUpdatedAt) {
stats.ImagesUpdatedAt = fileInfo.ModTime()