chg: fix: year detection algorithim
This commit is contained in:
@@ -159,7 +159,10 @@ func getTorrents(ctx context.Context, i *Indexer, link string) ([]IndexedTorrent
|
||||
text := s.Text()
|
||||
|
||||
audio = append(audio, findAudioFromText(text)...)
|
||||
year = findYearFromText(text, title)
|
||||
y := findYearFromText(text, title)
|
||||
if y != "" {
|
||||
year = y
|
||||
}
|
||||
size = append(size, findSizesFromText(text)...)
|
||||
})
|
||||
|
||||
@@ -283,6 +286,9 @@ func findYearFromText(text string, title string) (year string) {
|
||||
}
|
||||
|
||||
if year == "" {
|
||||
fmt.Println("DEBUG: year not found in text, trying to find in title")
|
||||
fmt.Println("DEBUG: title:", title)
|
||||
fmt.Println("DEBUG: text:", text)
|
||||
re = regexp.MustCompile(`\((\d{4})\)`)
|
||||
yearMatch := re.FindStringSubmatch(title)
|
||||
if len(yearMatch) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user