Skip to content

Commit

Permalink
feat: skip everything that not 'DefaultAudioFormat' for generating
Browse files Browse the repository at this point in the history
atom entries
  • Loading branch information
nlif-m committed Jan 30, 2024
1 parent 31eb333 commit b048d06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions atomgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ func (atomgen *Atomgen) getEntries() (entries []*atom.Entry, err error) {
log.Printf("ERROR: when getting entries from %s", atomgen.cfg.SrcFolder)
return nil, err
}

DefaultAudioFormatExt := "." + atomgen.cfg.DownloadAudioFormat
entries = make([]*atom.Entry, 0, len(files))
filesLoop:
for _, file := range files {
Expand All @@ -81,8 +83,7 @@ filesLoop:
Name := file.Name()

Ext := filepath.Ext(Name)
switch Ext {
case ".part", ".ytdl", ".xml", ".json":
if Ext != DefaultAudioFormatExt {
continue filesLoop
}

Expand Down

0 comments on commit b048d06

Please sign in to comment.