mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
feat(filters): skip duplicates (#1711)
* feat(filters): skip duplicates * fix: add interface instead of any * fix(filters): tonullint * feat(filters): skip dupes check month day * chore: cleanup * feat(db): set autoincrement id * feat(filters): add repack and proper to dupe profile * feat(filters): add default dupe profiles * feat(duplicates): check audio and website * feat(duplicates): update tests * feat(duplicates): add toggles on addform * feat(duplicates): fix sqlite upgrade path and initialize duplicate profiles * feat(duplicates): simplify sqlite upgrade avoiding temp table and unwieldy select. Besides, FK constraints are turned off anyway in #229. * feat(duplicates): change CheckIsDuplicateRelease treatment of PROPER and REPACK "Proper" and "Repack" are not parallel to the other conditions like "Title", so they do not belong as dedup conditions. "PROPER" means there was an issue in the previous release, and so a PROPER is never a duplicate, even if it replaces another PROPER. Similarly, "REPACK" means there was an issue in the previous release by that group, and so it is a duplicate only if we previously took a release from a DIFFERENT group. I have not removed Proper and Repack from the UI or the schema yet. * feat(duplicates): update postgres schema to match sqlite * feat(duplicates): fix web build errors * feat(duplicates): fix postgres errors * feat(filters): do leftjoin for duplicate profile * fix(filters): partial update dupe profile * go fmt `internal/domain/filter.go` * feat(duplicates): restore straightforward logic for proper/repack * feat(duplicates): remove mostly duplicate TV duplicate profiles Having one profile seems the cleanest. If somebody wants multiple resolutions then they can add Resolution to the duplicate profile. Tested this profile with both weekly episodic releases and daily show releases. * feat(release): add db indexes and sub_title * feat(release): add IsDuplicate tests * feat(release): update action handler * feat(release): add more tests for skip duplicates * feat(duplicates): check audio * feat(duplicates): add more tests * feat(duplicates): match edition cut and more * fix(duplicates): tests * fix(duplicates): missing imports * fix(duplicates): tests * feat(duplicates): handle sub_title edition and language in ui * fix(duplicates): tests * feat(duplicates): check name against normalized hash * fix(duplicates): tests * chore: update .gitignore to ignore .pnpm-store * fix: tests * fix(filters): tests * fix: bad conflict merge * fix: update release type in test * fix: use vendored hot-toast * fix: release_test.go * fix: rss_test.go * feat(duplicates): improve title hashing for unique check * feat(duplicates): further improve title hashing for unique check with lang * feat(duplicates): fix tests * feat(duplicates): add macros IsDuplicate and DuplicateProfile ID and name * feat(duplicates): add normalized hash match option * fix: headlessui-state prop warning * fix(duplicates): add missing year in daily ep normalize * fix(duplicates): check rejections len --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
d153ac44b8
commit
4009554d10
49 changed files with 3792 additions and 743 deletions
|
@ -6,6 +6,7 @@ package domain
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/moistari/rls"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -21,19 +22,20 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Servant S01 2160p ATVP WEB-DL DDP 5.1 Atmos DV HEVC-FLUX",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant S01 2160p ATVP WEB-DL DDP 5.1 Atmos DV HEVC-FLUX",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
//Website: "ATVP",
|
||||
Type: "series",
|
||||
TorrentName: "Servant S01 2160p ATVP WEB-DL DDP 5.1 Atmos DV HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -42,18 +44,20 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Type: "series",
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -63,20 +67,22 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MKV / 2160p / WEB-DL",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
ReleaseTags: "MKV / 2160p / WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mkv",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Type: "series",
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
ReleaseTags: "MKV / 2160p / WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mkv",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -86,20 +92,22 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MKV | 2160p | WEB-DL",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
ReleaseTags: "MKV | 2160p | WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mkv",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Type: "series",
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
ReleaseTags: "MKV | 2160p | WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mkv",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -109,20 +117,22 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MP4 | 2160p | WEB-DL",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
ReleaseTags: "MP4 | 2160p | WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mp4",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Type: "series",
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
ReleaseTags: "MP4 | 2160p | WEB-DL",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mp4",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -132,22 +142,24 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MP4 | 2160p | WEB-DL | Freeleech!",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
ReleaseTags: "MP4 | 2160p | WEB-DL | Freeleech!",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mp4",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Freeleech: true,
|
||||
Bonus: []string{"Freeleech"},
|
||||
Type: "series",
|
||||
TorrentName: "Servant.S01.2160p.ATVP.WEB-DL.DDP.5.1.Atmos.DV.HEVC-FLUX",
|
||||
NormalizedHash: "9b73e77d51fb0b69367ea96c761577b0",
|
||||
ReleaseTags: "MP4 | 2160p | WEB-DL | Freeleech!",
|
||||
Title: "Servant",
|
||||
Season: 1,
|
||||
Episode: 0,
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Container: "mp4",
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DDP", "Atmos"},
|
||||
AudioChannels: "5.1",
|
||||
HDR: []string{"DV"},
|
||||
Group: "FLUX",
|
||||
Freeleech: true,
|
||||
Bonus: []string{"Freeleech"},
|
||||
Website: "ATVP",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -156,15 +168,16 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Rippers.Revenge.2023.German.DL.1080p.BluRay.MPEG2-GROUP",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Rippers.Revenge.2023.German.DL.1080p.BluRay.MPEG2-GROUP",
|
||||
Title: "Rippers Revenge",
|
||||
Year: 2023,
|
||||
Language: []string{"GERMAN", "DL"},
|
||||
Resolution: "1080p",
|
||||
Source: "BluRay",
|
||||
Codec: []string{"MPEG-2"},
|
||||
Group: "GROUP",
|
||||
Type: "movie",
|
||||
TorrentName: "Rippers.Revenge.2023.German.DL.1080p.BluRay.MPEG2-GROUP",
|
||||
NormalizedHash: "cb28c69ce117723d01ea6562ef3bae67",
|
||||
Title: "Rippers Revenge",
|
||||
Year: 2023,
|
||||
Language: []string{"GERMAN", "DL"},
|
||||
Resolution: "1080p",
|
||||
Source: "BluRay",
|
||||
Codec: []string{"MPEG-2"},
|
||||
Group: "GROUP",
|
||||
Type: rls.Movie,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -173,13 +186,14 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Analogue.1080i.AHDTV.H264-ABCDEF",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Analogue.1080i.AHDTV.H264-ABCDEF",
|
||||
Title: "Analogue",
|
||||
Resolution: "1080p", // rls does not differentiate between 1080i and 1080p which results in all 1080 releases being parsed as 1080p
|
||||
Source: "AHDTV",
|
||||
Codec: []string{"H.264"},
|
||||
Group: "ABCDEF",
|
||||
Type: "movie",
|
||||
TorrentName: "Analogue.1080i.AHDTV.H264-ABCDEF",
|
||||
NormalizedHash: "1a1eb25b15269d3189138326658aafe0",
|
||||
Title: "Analogue",
|
||||
Resolution: "1080p", // rls does not differentiate between 1080i and 1080p which results in all 1080 releases being parsed as 1080p
|
||||
Source: "AHDTV",
|
||||
Codec: []string{"H.264"},
|
||||
Group: "ABCDEF",
|
||||
Type: rls.Movie,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -189,17 +203,18 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Artist - Albumname",
|
||||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"Cue", "FLAC", "Lossless", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
TorrentName: "Artist - Albumname",
|
||||
NormalizedHash: "5de820bfae23f2bdc3a56c827a5230ac",
|
||||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"Cue", "FLAC", "Lossless", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -210,14 +225,15 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MP3 / 320 / Cassette",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Various Artists - Music '21",
|
||||
Tags: []string{"house, techno, tech.house, electro.house, future.house, bass.house, melodic.house"},
|
||||
ReleaseTags: "MP3 / 320 / Cassette",
|
||||
Title: "Various Artists - Music '21",
|
||||
Source: "Cassette",
|
||||
Audio: []string{"320", "MP3"},
|
||||
AudioFormat: "MP3",
|
||||
Bitrate: "320",
|
||||
TorrentName: "Various Artists - Music '21",
|
||||
NormalizedHash: "fbf7713532f4d2d03b62897fc990e37e",
|
||||
Tags: []string{"house, techno, tech.house, electro.house, future.house, bass.house, melodic.house"},
|
||||
ReleaseTags: "MP3 / 320 / Cassette",
|
||||
Title: "Various Artists - Music '21",
|
||||
Source: "Cassette",
|
||||
Audio: []string{"320", "MP3"},
|
||||
AudioFormat: "MP3",
|
||||
Bitrate: "320",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -227,14 +243,15 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "MP3 / V0 (VBR) / CD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "The artist (ザ・フリーダムユニティ) - Long album name",
|
||||
ReleaseTags: "MP3 / V0 (VBR) / CD",
|
||||
Title: "The artist",
|
||||
Group: "name",
|
||||
Source: "CD",
|
||||
Audio: []string{"MP3", "VBR", "V0 (VBR)"},
|
||||
AudioFormat: "MP3",
|
||||
Bitrate: "V0 (VBR)",
|
||||
TorrentName: "The artist (ザ・フリーダムユニティ) - Long album name",
|
||||
NormalizedHash: "6b4051de7524f65d3c25be535d2c95ed",
|
||||
ReleaseTags: "MP3 / V0 (VBR) / CD",
|
||||
Title: "The artist",
|
||||
Group: "name",
|
||||
Source: "CD",
|
||||
Audio: []string{"MP3", "VBR", "V0 (VBR)"},
|
||||
AudioFormat: "MP3",
|
||||
Bitrate: "V0 (VBR)",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -244,17 +261,18 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Artist - Albumname",
|
||||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"Cue", "FLAC", "Lossless", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
TorrentName: "Artist - Albumname",
|
||||
NormalizedHash: "5de820bfae23f2bdc3a56c827a5230ac",
|
||||
ReleaseTags: "FLAC / Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"Cue", "FLAC", "Lossless", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -264,17 +282,18 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "FLAC / 24bit Lossless / Log / 100% / Cue / CD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Artist - Albumname",
|
||||
ReleaseTags: "FLAC / 24bit Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"24BIT Lossless", "Cue", "FLAC", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "24BIT Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
TorrentName: "Artist - Albumname",
|
||||
NormalizedHash: "5de820bfae23f2bdc3a56c827a5230ac",
|
||||
ReleaseTags: "FLAC / 24bit Lossless / Log / 100% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"24BIT Lossless", "Cue", "FLAC", "Log100", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "24BIT Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 100,
|
||||
HasCue: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -284,17 +303,18 @@ func TestRelease_Parse(t *testing.T) {
|
|||
ReleaseTags: "FLAC / 24bit Lossless / Log / 78% / Cue / CD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Artist - Albumname",
|
||||
ReleaseTags: "FLAC / 24bit Lossless / Log / 78% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"24BIT Lossless", "Cue", "FLAC", "Log78", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "24BIT Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 78,
|
||||
HasCue: true,
|
||||
TorrentName: "Artist - Albumname",
|
||||
NormalizedHash: "5de820bfae23f2bdc3a56c827a5230ac",
|
||||
ReleaseTags: "FLAC / 24bit Lossless / Log / 78% / Cue / CD",
|
||||
Title: "Artist",
|
||||
Group: "Albumname",
|
||||
Audio: []string{"24BIT Lossless", "Cue", "FLAC", "Log78", "Log"},
|
||||
AudioFormat: "FLAC",
|
||||
Source: "CD",
|
||||
Bitrate: "24BIT Lossless",
|
||||
HasLog: true,
|
||||
LogScore: 78,
|
||||
HasCue: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -303,18 +323,22 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "I Am Movie 2007 Theatrical UHD BluRay 2160p DTS-HD MA 5.1 DV HEVC HYBRID REMUX-GROUP1",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "I Am Movie 2007 Theatrical UHD BluRay 2160p DTS-HD MA 5.1 DV HEVC HYBRID REMUX-GROUP1",
|
||||
Title: "I Am Movie",
|
||||
Resolution: "2160p",
|
||||
Source: "UHD.BluRay",
|
||||
Codec: []string{"HEVC"},
|
||||
HDR: []string{"DV"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Year: 2007,
|
||||
Group: "GROUP1",
|
||||
Other: []string{"HYBRiD", "REMUX"},
|
||||
Type: "movie",
|
||||
TorrentName: "I Am Movie 2007 Theatrical UHD BluRay 2160p DTS-HD MA 5.1 DV HEVC HYBRID REMUX-GROUP1",
|
||||
NormalizedHash: "f70840f42149d7d2b539c75f5e853493",
|
||||
Title: "I Am Movie",
|
||||
Resolution: "2160p",
|
||||
Source: "UHD.BluRay",
|
||||
Codec: []string{"HEVC"},
|
||||
HDR: []string{"DV"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Year: 2007,
|
||||
Group: "GROUP1",
|
||||
Hybrid: true,
|
||||
Cut: []string{"Theatrical.Cut"},
|
||||
MediaProcessing: "REMUX",
|
||||
Other: []string{"HYBRiD", "REMUX"},
|
||||
Type: rls.Movie,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -323,19 +347,21 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "The Peripheral (2022) S01 (2160p AMZN WEB-DL H265 HDR10+ DDP 5.1 English - GROUP1)",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "The Peripheral (2022) S01 (2160p AMZN WEB-DL H265 HDR10+ DDP 5.1 English - GROUP1)",
|
||||
Title: "The Peripheral",
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"H.265"},
|
||||
HDR: []string{"HDR10+"},
|
||||
Audio: []string{"DDP"},
|
||||
AudioChannels: "5.1",
|
||||
Year: 2022,
|
||||
Group: "GROUP1",
|
||||
Season: 1,
|
||||
Language: []string{"ENGLiSH"},
|
||||
Type: "series",
|
||||
TorrentName: "The Peripheral (2022) S01 (2160p AMZN WEB-DL H265 HDR10+ DDP 5.1 English - GROUP1)",
|
||||
NormalizedHash: "33fe914c00ea5a2945883cffb4183923",
|
||||
Title: "The Peripheral",
|
||||
Resolution: "2160p",
|
||||
Source: "WEB-DL",
|
||||
Codec: []string{"H.265"},
|
||||
HDR: []string{"HDR10+"},
|
||||
Audio: []string{"DDP"},
|
||||
AudioChannels: "5.1",
|
||||
Year: 2022,
|
||||
Group: "GROUP1",
|
||||
Season: 1,
|
||||
Language: []string{"ENGLiSH"},
|
||||
Website: "AMZN",
|
||||
Type: rls.Series,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -344,18 +370,20 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-CiNEPHiLES",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-CiNEPHiLES",
|
||||
Title: "Old Movie",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "CiNEPHiLES",
|
||||
Type: "movie",
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-CiNEPHiLES",
|
||||
Title: "Old Movie",
|
||||
NormalizedHash: "9990678babd4f24f268dfe7856b29f0e",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "CiNEPHiLES",
|
||||
Type: rls.Movie,
|
||||
MediaProcessing: "REMUX",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -364,17 +392,19 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Death Hunt 1981 1080p Remux AVC DTS-HD MA 2.0-playBD",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Death Hunt 1981 1080p Remux AVC DTS-HD MA 2.0-playBD",
|
||||
Title: "Death Hunt",
|
||||
Year: 1981,
|
||||
Source: "BluRay",
|
||||
Resolution: "1080p",
|
||||
Other: []string{"REMUX"},
|
||||
Codec: []string{"AVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "2.0",
|
||||
Group: "playBD",
|
||||
Type: "movie",
|
||||
TorrentName: "Death Hunt 1981 1080p Remux AVC DTS-HD MA 2.0-playBD",
|
||||
Title: "Death Hunt",
|
||||
NormalizedHash: "e6b1b708b8ea39470de6d327da2920d6",
|
||||
Year: 1981,
|
||||
Source: "BluRay",
|
||||
Resolution: "1080p",
|
||||
Other: []string{"REMUX"},
|
||||
Codec: []string{"AVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "2.0",
|
||||
Group: "playBD",
|
||||
Type: rls.Movie,
|
||||
MediaProcessing: "REMUX",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -383,18 +413,20 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-VHS",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-VHS",
|
||||
Title: "Old Movie",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "VHS",
|
||||
Type: "movie",
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1-VHS",
|
||||
Title: "Old Movie",
|
||||
NormalizedHash: "1ea814c8c21979e7692efb1b24298e95",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "VHS",
|
||||
Type: rls.Movie,
|
||||
MediaProcessing: "REMUX",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -403,18 +435,20 @@ func TestRelease_Parse(t *testing.T) {
|
|||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1 VHS",
|
||||
},
|
||||
want: Release{
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1 VHS",
|
||||
Title: "Old Movie",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "VHS",
|
||||
Type: "movie",
|
||||
TorrentName: "Old Movie 1954 2160p Remux DoVi HDR10 HEVC DTS-HD MA 5.1 VHS",
|
||||
Title: "Old Movie",
|
||||
NormalizedHash: "1ea814c8c21979e7692efb1b24298e95",
|
||||
Year: 1954,
|
||||
Source: "UHD.BluRay",
|
||||
Resolution: "2160p",
|
||||
Other: []string{"REMUX"},
|
||||
HDR: []string{"DV", "HDR10"},
|
||||
Codec: []string{"HEVC"},
|
||||
Audio: []string{"DTS-HD.MA"},
|
||||
AudioChannels: "5.1",
|
||||
Group: "VHS",
|
||||
Type: rls.Movie,
|
||||
MediaProcessing: "REMUX",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -863,3 +897,220 @@ func Test_getUniqueTags(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRelease_Hash(t *testing.T) {
|
||||
type fields struct {
|
||||
TorrentName string
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "1",
|
||||
fields: fields{
|
||||
TorrentName: "That.Movie.2023.2160p.BluRay.DTS-HD.5.1.x265-GROUP",
|
||||
},
|
||||
want: "833e6c4c78e960ccbce4ef68f6564082",
|
||||
},
|
||||
{
|
||||
name: "2",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 2160p BluRay DTS-HD 5.1 x265-GROUP",
|
||||
},
|
||||
want: "833e6c4c78e960ccbce4ef68f6564082",
|
||||
},
|
||||
{
|
||||
name: "3",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 2160p BluRay DTS-HD 5 1 x265-GROUP",
|
||||
},
|
||||
want: "833e6c4c78e960ccbce4ef68f6564082",
|
||||
},
|
||||
{
|
||||
name: "4",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 1080p Remux DTS-HD 5 1 AVC-GROUP",
|
||||
},
|
||||
want: "ee15fe3c926a5b40370aec970f6b4c43",
|
||||
},
|
||||
{
|
||||
name: "5",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP",
|
||||
},
|
||||
want: "ee15fe3c926a5b40370aec970f6b4c43",
|
||||
},
|
||||
{
|
||||
name: "6",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 Theatrical Cut Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP",
|
||||
},
|
||||
want: "db7e55fb3471e76ba27bf8a2e1e59236",
|
||||
},
|
||||
{
|
||||
name: "7",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2023 Directors Cut Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP",
|
||||
},
|
||||
want: "bccfe6762b34cbc3a54784351b5424fd",
|
||||
},
|
||||
{
|
||||
name: "8",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01 Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP",
|
||||
},
|
||||
want: "d1c74c33e1c36f3545d06aa8857610b1",
|
||||
},
|
||||
{
|
||||
name: "9",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01 Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP2",
|
||||
},
|
||||
want: "29e228f705f070041e72ebaa7b29239e",
|
||||
},
|
||||
{
|
||||
name: "10",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S1 Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP2",
|
||||
},
|
||||
want: "29e228f705f070041e72ebaa7b29239e",
|
||||
},
|
||||
{
|
||||
name: "11",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S2 Bluray 1080p Remux DTS-HD 5.1 AVC-GROUP2",
|
||||
},
|
||||
want: "cbc67f4eec93428361eddf040654e077",
|
||||
},
|
||||
{
|
||||
name: "12",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "806240c76cc32413efd5bcf033abf512",
|
||||
},
|
||||
{
|
||||
name: "13",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "33c866b898a59d255a09c10bd23a5e3f",
|
||||
},
|
||||
{
|
||||
name: "14",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 REPACK S01E01 This is the start 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "7be5ebeee948820f53f24091054fc7cd",
|
||||
},
|
||||
{
|
||||
name: "15",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 REPACK2 S01E01 This is the start 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "84e3e70f6c983f96f10cba50213a338d",
|
||||
},
|
||||
{
|
||||
name: "16",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 PROPER S01E01 This is the start 2160p WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "52d5d1a28a340bc5a836c0244c206c3b",
|
||||
},
|
||||
{
|
||||
name: "17",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p WEB-DL DV DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "5e196039d426649ab5221c3e87ed108d",
|
||||
},
|
||||
{
|
||||
name: "18",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p WEB-DL DoVi DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "5e196039d426649ab5221c3e87ed108d",
|
||||
},
|
||||
{
|
||||
name: "19",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p WEB-DL DoVi HDR10 DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "f52a9a2f26e94c90bdaa8eaca2136cc3",
|
||||
},
|
||||
{
|
||||
name: "20",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p WEB-DL DV HDR10 DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "f52a9a2f26e94c90bdaa8eaca2136cc3",
|
||||
},
|
||||
{
|
||||
name: "21",
|
||||
fields: fields{
|
||||
TorrentName: "that show 2023 S01E01 this is the start 2160p WEB-DL DV HDR10 DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "f52a9a2f26e94c90bdaa8eaca2136cc3",
|
||||
},
|
||||
{
|
||||
name: "22",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 S01E01 This is the start 2160p HYBRID WEB-DL DV HDR10 DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "414f792a345148ed4c8e070ef77340ff",
|
||||
},
|
||||
{
|
||||
name: "23",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2008 1080p GBR Blu-ray AVC TrueHD 5.1",
|
||||
},
|
||||
want: "70bb23ff5da4209419b6d83628310a43",
|
||||
},
|
||||
{
|
||||
name: "24",
|
||||
fields: fields{
|
||||
TorrentName: "That Movie 2008 1080p GER Blu-ray AVC TrueHD 5.1",
|
||||
},
|
||||
want: "369ba9f92fb7819e0d07791fddf3c85f",
|
||||
},
|
||||
{
|
||||
name: "25",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 PROPER S01E01 This is the start 2160p AMZN WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "28e215fee790fbad3957383162f7c5a6",
|
||||
},
|
||||
{
|
||||
name: "26",
|
||||
fields: fields{
|
||||
TorrentName: "That Show 2023 PROPER S01E01 This is the start 2160p DSNP WEB-DL DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "6a26cd652170d0efc4b0e0320fbd38c1",
|
||||
},
|
||||
{
|
||||
name: "27",
|
||||
fields: fields{
|
||||
TorrentName: "That Other Show 2023 S01E01 2160p WEB-DL DV HDR10 DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "544c2fc4024ece5664c0f623a5feaeab",
|
||||
},
|
||||
{
|
||||
name: "28",
|
||||
fields: fields{
|
||||
TorrentName: "That Other Show 2023 S01E01 2160p WEB-DL DV HDR10+ DTS-HD 5.1 HEVC-GROUP",
|
||||
},
|
||||
want: "63b5d87abe5fb49131785de426708d31",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
r := &Release{
|
||||
TorrentName: tt.fields.TorrentName,
|
||||
}
|
||||
r.ParseString(tt.fields.TorrentName)
|
||||
assert.Equalf(t, tt.want, r.NormalizedHash, "Hash()")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue