mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(feeds): always upgrade size from RSS description (#1458)
* fix(rss): add additional test for size * always upgrade from desc
This commit is contained in:
parent
93538d0254
commit
d86b2333a7
2 changed files with 7 additions and 4 deletions
|
@ -210,10 +210,8 @@ func (j *RSSJob) processItem(item *gofeed.Item) *domain.Release {
|
|||
if item.Description != "" {
|
||||
rls.Description = item.Description
|
||||
|
||||
if rls.Size == 0 {
|
||||
readSizeFromDescription(item.Description, rls)
|
||||
j.Log.Trace().Msgf("Set new size %d from description", rls.Size)
|
||||
}
|
||||
readSizeFromDescription(item.Description, rls)
|
||||
j.Log.Trace().Msgf("Set new size %d from description", rls.Size)
|
||||
}
|
||||
|
||||
// add cookie to release for download if needed
|
||||
|
|
|
@ -269,6 +269,11 @@ func Test_readSizeFromDescription(t *testing.T) {
|
|||
str: "<strong>Uploaded</strong>: 38B minutes ago<br>Size: 32GB",
|
||||
want: "32GB",
|
||||
},
|
||||
{
|
||||
name: "upgrade size",
|
||||
str: `<p> <strong>Name</strong>: One.S01E01.German.DL.DTS.1080p.BluRay.x265.10bit-Cats<br> <strong>Category</strong>: Anime Serien<br> <strong>Type</strong>: Encode<br> <strong>Resolution</strong>: 1080p<br> <strong>Size</strong>: 2.49 GiB<br> <strong>Uploaded</strong>: vor 3 Minuten<br> <strong>Seeders</strong>: 1 | <strong>Leechers</strong>: 7 | <strong>Completed</strong>: 0<br> <strong>Uploader</strong>: Hochgeladen von xxx <br> IMDB Link:<a href="https://anon.to?http://www.imdb.com/title/tt1" target="_blank">tt1</a><br> TMDB Link: <a href="https://anon.to?https://www.themoviedb.org/tv/1" target="_blank">1</a><br> </p>`,
|
||||
want: "2.49GiB",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue