From f140a8e12dc4e50d356cacc8a7660267c3e9c290 Mon Sep 17 00:00:00 2001 From: Dan Audne Date: Sat, 22 Apr 2023 23:46:18 +0200 Subject: [PATCH] refactor: group source rip in regex --- go.mod | 3 ++- go.sum | 1 + source.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 28c857c..41b747d 100644 --- a/go.mod +++ b/go.mod @@ -2,9 +2,10 @@ module github.com/ProfChaos/torrent-name-parser go 1.20 +require github.com/stretchr/testify v1.8.2 + require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/stretchr/testify v1.8.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 658c3d6..6a56e69 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/source.go b/source.go index a764f3c..8651fca 100644 --- a/source.go +++ b/source.go @@ -12,7 +12,7 @@ var ( ) func init() { - sourceGeneral = regexp.MustCompile(`(?i)\b(?:(?:HD-?)?CAM|HD-?Rip|HDTV|BRRip|BDRip|DVDRip|DVDscr|(?:HD-?)?TVRip|TC|PPVRip|R5|VHSSCR|Blu-?ray|WEB-?DL|WEB-?Rip|(?:DL|WEB|BD|BR|BDRE|RE)MUX)|WEB\b`) + sourceGeneral = regexp.MustCompile(`(?i)\b(?:(?:HD-?)?CAM|(?:DVD|VHS)scr|TC|HDTV|R5|Blu-?ray|WEB-?(?:DL)?|(?:BR|BD|DVD|PPV|WEB|HD|(?:HD-?)?TV)-?Rip|(?:DL|WEB|BD|BR|BDRE|RE)MUX)\b`) sourceTelesync = regexp.MustCompile("(?i)\b(?:HD-?)?T(?:ELE)?S(?:YNC)?\b") sourceDvd = regexp.MustCompile("(?i)(DVD)(?:R[0-9])?") }