Skip to content

Commit 7d91a56

Browse files
authored
Merge pull request #4 from Dasnap/revert-1-min_age
Revert "Add min_age option for videos"
2 parents e9f2f7b + c3301f8 commit 7d91a56

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed

cmd/podsync/config_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ timeout = 15
3838
quality = "low"
3939
# duration filters are in seconds
4040
# max_age is in days
41-
# min_age is in days
42-
filters = { title = "regex for title here", min_duration = 0, max_duration = 86400, max_age = 365, min_age = 1}
41+
filters = { title = "regex for title here", min_duration = 0, max_duration = 86400, max_age = 365}
4342
playlist_sort = "desc"
4443
clean = { keep_last = 10 }
4544
[feeds.XYZ.custom]
@@ -83,7 +82,6 @@ timeout = 15
8382
assert.EqualValues(t, 0, feed.Filters.MinDuration)
8483
assert.EqualValues(t, 86400, feed.Filters.MaxDuration)
8584
assert.EqualValues(t, 365, feed.Filters.MaxAge)
86-
assert.EqualValues(t, 1, feed.Filters.MinAge)
8785
assert.EqualValues(t, 10, feed.Clean.KeepLast)
8886
assert.EqualValues(t, model.SortingDesc, feed.PlaylistSort)
8987

config.toml.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ vimeo = [ # Multiple keys will be rotated.
8383
# If set, then only download matching episodes.
8484
# Duration filters are in seconds.
8585
# max_age filter is in days.
86-
# min_age filter is in days.
87-
filters = { title = "regex for title here", not_title = "regex for negative title match", description = "...", not_description = "...", min_duration = 0, max_duration = 86400, max_age = 365, min_age = 1 }
86+
filters = { title = "regex for title here", not_title = "regex for negative title match", description = "...", not_description = "...", min_duration = 0, max_duration = 86400, max_age = 365 }
8887

8988
# Optional extra arguments passed to youtube-dl when downloading videos from this feed.
9089
# This example would embed available English closed captions in the videos.

pkg/feed/config.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ type Filters struct {
5959
MinDuration int64 `toml:"min_duration"`
6060
MaxDuration int64 `toml:"max_duration"`
6161
MaxAge int `toml:"max_age"`
62-
MinAge int `toml:"min_age"`
6362
// More filters to be added here
6463
}
6564

services/update/matcher.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,5 @@ func matchFilters(episode *model.Episode, filters *feed.Filters) bool {
6060
}
6161
}
6262

63-
if filters.MinAge > 0 {
64-
dateDiff := int(time.Since(episode.PubDate).Hours()) / 24
65-
if dateDiff < filters.MaxAge {
66-
logger.WithField("filter", "min_age").Infof("skipping due to min_age filter (%dd < %dd)", dateDiff, filters.MinAge)
67-
return false
68-
}
69-
}
70-
7163
return true
7264
}

0 commit comments

Comments
 (0)