From b0198bc2a38738abb8811efcf2b2370bb94641b5 Mon Sep 17 00:00:00 2001 From: martylukyy <35452459+martylukyy@users.noreply.github.com> Date: Wed, 26 Apr 2023 20:31:21 +0200 Subject: [PATCH] fix(indexers): OPS new announce format (#862) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix ops parsing extend regex capture group for torrentName var to contain releaseTags var replace all – in announces with a - for torrentName var * update ops yaml for new announces * replace en-dashes with hyphens for OPS add Sampler to releaseTypeMusic const sort strings of releaseTypeMusic const alphabetically shorten import in constants.ts * replace en-dashes in pattern with . to cover any separator --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> --- internal/announce/announce.go | 6 ++++++ internal/indexer/definitions/orpheus.yaml | 10 ++++++---- web/src/domain/constants.ts | 21 +++++++++++---------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/internal/announce/announce.go b/internal/announce/announce.go index 404e3f0..96087e6 100644 --- a/internal/announce/announce.go +++ b/internal/announce/announce.go @@ -199,6 +199,12 @@ func (a *announceProcessor) onLinesMatched(def *domain.IndexerDefinition, vars m return err } + // since OPS uses en-dashes as separators, which causes moistari/rls to not the torrentName properly, + // we replace the en-dashes with hyphens here + if def.Identifier == "ops" { + rls.TorrentName = strings.ReplaceAll(rls.TorrentName, "–", "-") + } + // parse fields // run before ParseMatch to not potentially use a reconstructed TorrentName rls.ParseString(rls.TorrentName) diff --git a/internal/indexer/definitions/orpheus.yaml b/internal/indexer/definitions/orpheus.yaml index 9ecc80e..f677f8e 100644 --- a/internal/indexer/definitions/orpheus.yaml +++ b/internal/indexer/definitions/orpheus.yaml @@ -58,12 +58,14 @@ irc: type: single lines: - test: - - "TORRENT: Amarok – Quentadharkën – CD/FLAC/Lossless – folk.rock,progressive.rock – https://orpheus.network/torrents.php?id=000000 – https://orpheus.network/torrents.php?id=000000&torrentid=000000&action=download" - - "TORRENT: Signal Lost – Simulacrum – WEB/FLAC/24bit Lossless – 2020s,alternative.rock,freely.available,post.rock,rock – https://orpheus.network/torrents.php?id=000000 – https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download" - - "TORRENT: Anne Sila – Fruit défendu – CD/FLAC/Lossless – – https://orpheus.network/torrents.php?id=000000 – https://orpheus.network/torrents.php?id=000000&torrentid=0000000&action=download" - pattern: 'TORRENT: (.*) . (.*) . (.*) . .* (https:\/\/.*\/).*&torrentid=(.+)&action=download' + - "TORRENT: Dirty Dike – Bogies & Alcohol – [2008] [Album] CD/MP3/320 – hip.hop,uk.hip.hop,united.kingdom – https://orpheus.network/torrents.php?id=0000000 – https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download" + - "TORRENT: Various Artists – Bicycle Day: 85 Yrs of LSD Special – [2023] [Compilation] WEB/FLAC/Lossless – ambient,electronic – https://orpheus.network/torrents.php?id=0000000 – https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download" + - "TORRENT: Snoop Dogg – Untitled – [2001] [Sampler] Vinyl/MP3/320 – – https://orpheus.network/torrents.php?id=0000000 – https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download" + pattern: 'TORRENT: (.* . \[(.*?)\] \[(.*?)\] (.*)) . \s*(.*) . https?:\/\/.* . (https?:\/\/.*\/).*torrentid=(\d+).*' vars: - torrentName + - year + - category - releaseTags - tags - baseUrl diff --git a/web/src/domain/constants.ts b/web/src/domain/constants.ts index 5269416..b684dd5 100644 --- a/web/src/domain/constants.ts +++ b/web/src/domain/constants.ts @@ -1,4 +1,4 @@ -import { MultiSelectOption } from "../components/inputs/select"; +import { MultiSelectOption } from "@/components/inputs/select"; export const resolutions = [ "2160p", @@ -127,19 +127,20 @@ export const QUALITY_MUSIC_OPTIONS: MultiSelectOption[] = qualityMusic.map(v => export const releaseTypeMusic = [ "Album", - "Single", - "EP", - "Soundtrack", "Anthology", - "Compilation", - "Live album", - "Remix", "Bootleg", - "Interview", - "Mixtape", - "Demo", + "Compilation", "Concert Recording", + "Demo", "DJ Mix", + "EP", + "Interview", + "Live album", + "Mixtape", + "Remix", + "Sampler", + "Single", + "Soundtrack", "Unknown" ];