Commit graph

65 commits

Author SHA1 Message Date
1242c19883
Add support for using freeleech tokens if available 2025-07-11 10:12:43 +12:00
ze0s
ef7317dde6
feat(filters): show current download count in list (#2001)
* feat(filters): show current and max downloads in list

* feat(filters): remove unused func param
2025-03-16 18:33:47 +01:00
soup
0391629862
chore(license): update copyright year in headers (#1929)
* chore: update copyright year in license headers

* Revert "chore: update copyright year in license headers"

This reverts commit 3e58129c431b9a491089ce36b908f9bb6ba38ed3.

* chore: update copyright year in license headers

* fix: sort go imports

* fix: add missing license headers
2025-01-06 22:23:19 +01:00
kenstir
4009554d10
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>
2024-12-25 22:33:46 +01:00
soup
d153ac44b8
feat(filters): RED and OPS fetch record label from API (#1881)
* feat(filters): RED and OPS fetch record label from API

* test: add record label to RED and OPS test data

* refactor: record label check

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-12-25 13:39:03 +01:00
ze0s
221bc35371
feat(lists): integrate Omegabrr (#1885)
* feat(lists): integrate Omegabrr

* feat(lists): add missing lists index

* feat(lists): add db repo

* feat(lists): add db migrations

* feat(lists): labels

* feat(lists): url lists and more arrs

* fix(lists): db migrations client_id wrong type

* fix(lists): db fields

* feat(lists): create list form wip

* feat(lists): show in list and create

* feat(lists): update and delete

* feat(lists): trigger via webhook

* feat(lists): add webhook handler

* fix(arr): encode json to pointer

* feat(lists): rename endpoint to lists

* feat(lists): fetch tags from arr

* feat(lists): process plaintext lists

* feat(lists): add background refresh job

* run every 6th hour with a random start delay between 1-35 seconds

* feat(lists): refresh on save and improve logging

* feat(lists): cast arr client to pointer

* feat(lists): improve error handling

* feat(lists): reset shows field with match release

* feat(lists): filter opts all lists

* feat(lists): trigger on update if enabled

* feat(lists): update option for lists

* feat(lists): show connected filters in list

* feat(lists): missing listSvc dep

* feat(lists): cleanup

* feat(lists): typo arr list

* feat(lists): radarr include original

* feat(lists): rename ExcludeAlternateTitle to IncludeAlternateTitle

* fix(lists): arr client type conversion to pointer

* fix(actions): only log panic recover if err not nil

* feat(lists): show spinner on save

* feat(lists): show icon in filters list

* feat(lists): change icon color in filters list

* feat(lists): delete relations on filter delete
2024-12-25 13:23:37 +01:00
ze0s
f644b3a4d6
feat(filters): implement AnnounceType (#1837)
* feat(filters): implement AnnounceType

* fix: rss tests
2024-12-08 21:08:24 +01:00
Carmelo Scandaliato
d15b61870e
fix(filters): release download counts (#1739)
* fix(database): count multiple actions per filter as one download

* fix(database): change queries and add tests

* fix(releases): add additional testdata

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-10-06 14:52:20 +02:00
ze0s
accc875960
feat(database): improve error handling (#1633) 2024-08-29 09:00:53 +02:00
ze0s
861f30c144
fix(actions): reject if client is disabled (#1626)
* fix(actions): error on disabled client

* fix(actions): sql scan args

* refactor: download client cache for actions

* fix: tests client store

* fix: tests client store and int conversion

* fix: tests revert findbyid ctx timeout

* fix: tests row.err

* feat: add logging to download client cache
2024-08-27 19:45:06 +02:00
kenstir
4fceccd611
feat(filters): support daily shows (#1462)
* feat(database): Add month, day columns to release table

* feat(database): Add month, day columns to postgres release table

* feat(filters): support daily show format

* feat(filters): check smart episode daily

* fix(tests): rss

* feat(filters): add daily shows elements to form

* enhancement(web): minimize html in MoviesAndTV tab

* feat(filters): smart episode check proper and repack

* feat(filters): smart episode do not allow multiple latest

* feat(filters): smart episode check group with repack

* feat(filters): smart episode allow multiple current releases

---------

Co-authored-by: s0up4200 <soup@r4tio.dev>
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-05-15 16:38:10 +02:00
martylukyy
1a23b69bcf
feat(web): move from react-router to @tanstack/router (#1338)
* fix(auth): invalid cookie handling and wrongful basic auth invalidation

* fix(auth): fix test to reflect new HTTP status code

* fix(auth/web): do not throw on error

* fix(http): replace http codes in middleware to prevent basic auth invalidation
fix typo in comment

* fix test

* fix(web): api client handle 403

* refactor(http): auth_test use testify.assert

* refactor(http): set session opts after valid login

* refactor(http): send more client headers

* fix(http): test

* refactor(web): move router to tanstack/router

* refactor(web): use route loaders and suspense

* refactor(web): useSuspense for settings

* refactor(web): invalidate cookie in middleware

* fix: loclfile

* fix: load filter/id

* fix(web): login, onboard, types, imports

* fix(web): filter load

* fix(web): build errors

* fix(web): ts-expect-error

* fix(tests): filter_test.go

* fix(filters): tests

* refactor: remove duplicate spinner components
refactor: ReleaseTable.tsx loading animation
refactor: remove dedicated `pendingComponent` for `settingsRoute`

* fix: refactor missed SectionLoader to RingResizeSpinner

* fix: substitute divides with borders to account for unloaded elements

* fix(api): action status URL param

* revert: action status URL param
add comment

* fix(routing): notfound handling and split files

* fix(filters): notfound get params

* fix(queries): colon

* fix(queries): comments ts-ignore

* fix(queries): extract queryKeys

* fix(queries): remove err

* fix(routes): move zob schema inline

* fix(auth): middleware and redirect to login

* fix(auth): failing test

* fix(logs): invalidate correct key

* fix(logs): invalidate correct key

* fix(logs): invalidate correct key

* fix: JSX element stealing focus from searchbar

* reimplement empty release table state text

* fix(context): use deep-copy

* fix(releases): empty state and filter input warnings

* fix(releases): empty states

* fix(auth): onboarding

* fix(cache): invalidate queries

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2024-02-12 13:07:00 +01:00
luckyboy
a86258aaa7
feat(filters): implement min and max seeders/leechers filtering for Torznab feeds (#1342)
* feat(filter):implement min and max seeders/leechers filtering

* chore: go fmt and reorder fields

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-01-12 17:08:18 +01:00
Frederick Robinson
256fbb49ba
docs(filters): explain GetDownloadsByFilterId (#1345)
add comment about GetDownloadsByFilterId
2024-01-10 17:37:18 +01:00
ze0s
45b522abf8
chore: update license header year (#1332)
* chore: update license header year

* chore: update license header year tsx files

* chore: update license header
2024-01-01 16:21:02 +01:00
ze0s
a0a81ed34c
fix(filters): ensure sort by priority (#1325)
* fix(filters): sort filters from filtersMap

* fix(filters): use slices.SortStableFunc and fix tests

* fix(filters): add local cmp pkg before go 1.21
2023-12-31 14:59:12 +01:00
soup
6e12654f6a
feat(filters): show enabled and disabled actions in list view (#1304)
* feat(filters): reflect enabled actions

* dont store release unless enabled action found

* store the release after the delay

* add new parameter to FindByFilterID method
2023-12-17 21:18:26 +01:00
Kyle Sanderson
3580472cbd
refactor(filters): optimize assignment to allocation (#1293)
nit(filters): move explicit assignment to allocation
2023-12-14 21:41:05 +01:00
Frederick Robinson
365055fbe1
refactor(filters): move rejections from release to filter (#1272)
* refactor: size check

* refactor(filters): checkfilter rejections from release to filter

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-12-01 18:04:23 +01:00
KaiserBh
666bdf68cd
feat(database): setup integration tests (#1118)
* refactor: this should be Debug() just like the rest.

* feat: catch error when updating client table.

Before if we provided the wrong ID it will just say it's successful when it shouldn't.

* chore: handle the errors.

* fix: defer tx.Rollback().

When I try handling the error we always hit the error no matter what even though there wasn't any error, This is due that defer block being executed unconditionally so even after we commit it successfully it will just give error. So add checking then commit it if all good.

* feat: added testing env.

This way we can use in memory sqlite.

* chore: Delete log should be debug as well.

* feat: enable foreign keys for testing for sqlite.

I recommend enabling all together. Not sure why it's commented but for now will keep it the same and only enable for testing.

* chore: catch error, if deleting a record fails.

* chore: catch error, if deleting a record fails.

* chore: catch error, when failed to enable toggle.

* chore: catch error, if updating failed.

* chore(filter): catch error, if deleting failed.

* chore(filter): catch error, if row is not modified for ToggleEnabled.

* chore(feed): Should be debug level to match with others.

* chore(feed): catch error when nothing is updated.

* chore: update docker-compose.yml add test_db for postgres.

* chore(ci): update include postgres db service before running tests.

* feat(database): Added database testing.

* feat(database): Added api integration testing.

* feat(database): Added action integration testing.

* feat(database): Added download_client integration testing.

* feat(database): Added filter integration testing.

* test(database): initial tests model (WIP)

* chore(feed): handle error when nothing is deleted.

* tests(feed): added delete testing.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* chore(feed): handle error when nothing is updated.

* feat(database): Added feed integration testing.

* fix(feed_cache): This should be time.Time not time.Duration.

* chore(feed_cache): handle error when deleting fails.

* feat(database): Added feed_cache integration testing.

* chore: add EOL

* feat: added indexer_test.go

* feat: added mock irc data

* fix: the column is not pass anymore it's password.

* chore: added assertion.

* fix: This is password column not pass test is failing because of it.

* feat: added tests cases for irc.

* feat: added test cases for release.

* feat: added test cases for notifications.

* feat: added Delete to the User DB that way it can be used for testing.

* feat: added user database tests.

* refactor: Make setupLogger and setupDatabase private also renamed them.

Changed the visibility of `setupLogger` to private based on feedback. Also renamed the function to `setupLoggerForTest` and `setupDatabaseForTest` to make its purpose more descriptive.

* fix(database): tests postgres ssl mode disable

* refactor(database): setup and teardown

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-11-18 20:04:30 +01:00
stacksmash76
e842a7bd42
enhancement(web): ui overhaul (#1155)
* Various WebUI changes and fixes.

* feat(tooltip): make tooltip display upwards

* fix(tooltip): place tooltip to the right

* fix(web): add missing ml-px to SwitchGroup header

current: https://i.imgur.com/2WXstPV.png
new: https://i.imgur.com/QGQ49mP.png

* fix(web): collapse sections

* fix(web):  improve freeleech section

* fix(web): rename action to action_components

Renamed the 'action' folder to 'action_components' to resolve import issues due to case sensitivity.

* fix(web): align CollapsibleSection

Old Advanced tab: https://i.imgur.com/MXaJ5eJ.png
New Advanced tab: https://i.imgur.com/4nPJJRw.png
Music tab for comparison: https://i.imgur.com/I59X7ot.png

* fix(web): remove invalid CSS class

* revert: vertical padding on switchgroup

added py-0 on the freeleech part instead

* feat(settings): add back log files

* fix(settings): irc channels and font sizes

* fix(components): radio select roundness

* fix(styling): various minor changes

* fix(filters): remove jitter fields

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: soup <soup@r4tio.dev>
Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-18 14:46:16 +01:00
Steven Kreitzer
c5fb92ccf4
fix(filters): external webhook remove jitter (#1254)
* fix(filters): external webhook remove jitter

* fix: migrations

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-17 17:05:29 +01:00
Steven Kreitzer
2080136669
feat(filters): external webhook retry on status codes (#1206)
* feat: external filter retry status codes

* chore: go mod tidy

* fix(database): migrations

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-10-27 17:37:57 +02:00
ze0s
3e244fac10
fix(filters): store and update with no external filters (#1049)
* fix(filters): store and update

* fix(filters): bad fmt var

* fix(filters): store expect status

* fix(filters): store expect status

* fix(filters): external filter always rejected
2023-08-17 21:42:43 +02:00
ze0s
dde0d0ed61
feat(filters): add support for multiple external filters (#1030)
* feat(filters): add support for multiple ext filters

* refactor(filters): crud and check

* feat(filters): add postgres migrations

* fix(filters): field array types

* fix(filters): formatting

* fix(filters): formatting

* feat(filters): external webhook improve logs
2023-08-15 23:07:39 +02:00
ze0s
e5b4ded725
feat(filters): add support for feed description (#922)
* feat(filters): match description

* feat(filters): support description

* chore: remove match logic for description

* fix: update rss tests
2023-05-13 19:33:18 +02:00
ze0s
de4a6c7661
fix(filters): max downloads include pending with postgres (#901)
fix(filters): max downloads include pending with Postgres
2023-05-02 19:55:43 +02:00
ze0s
604c7896bd
chore: add LICENSE GPLv2-or-later (#897)
* chore: add LICENSE

* chore: add LICENSE to README
2023-05-01 16:21:59 +02:00
ze0s
ef3445cbed
fix(releases): max downloads per hour (#883)
* fix(releases): max downloads per hour

* refactor: release processing

* compare apples to apples (#884)

* from rocketships back to apples

* Update internal/database/filter.go

* cast me to the

* keep your eye on the case

---------

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
2023-04-29 21:52:49 +02:00
Gustavo Machado
ef75b67b25
feat(filters): add match logic for tags and except tags (#810)
* feat(filters): add fields for tag and except tag matching logic

* refactor(filters): rearrange and simplify logic for containsAllMatch

---------

Co-authored-by: Gustavo Machado <me@gstv.dev>
2023-04-10 16:11:44 +02:00
ze0s
21c02dfab0
fix(filters): max downloads per filter check (#660) 2023-01-18 21:47:27 +01:00
ze0s
5c402b6d6c
feat(filters): support Language filtering (#632)
* feat(filters): add support for language

* feat(filters): add db migrations and repo

* feat(filters): fix failing tests

* feat(filters): fix failing tests
2023-01-09 00:33:08 +01:00
Kyle Sanderson
5da28a0918
fix(database): fix filter regression from clean-up (#599)
* fix(database): fix filter regression from clean-up

* rollback transaction commits

* fix(database): revert action count query
2022-12-31 12:27:42 +01:00
Kyle Sanderson
19b3899a5c
refactor(database): clean-up queries (#569)
* fix(database): build WHERE using squirrel

* flip LIKEs

* change sql.LevelReadCommitted

* feat(db): add missing commits

* implement single query for releases

* cleanup

* feat(releases): properly handle limit for Find

* feat(releases): make dynamic ILike helper

* feat(releases): check for empty ReleaseActionStatus

* add values as sql.NullX
* check if ID is non 0

* feat(releases): improve find
2022-12-30 23:53:45 +01:00
ze0s
38795be9ea
feat(filters): smart episode (#563)
* feat(filters): initial smart episode

* feat(smart-episode): pseudo-logic

* feat(filters): check releases

* feat(filters): update logic

* feat(web): smart episode (#562)

* add frontend part for smart episode feature

* change description for smart episode help text

* fix wording

* feat(filters): smart-episode logic

Co-authored-by: Kyle Sanderson <kyle.leet@gmail.com>
Co-authored-by: xoaaC <35452459+xoaaC@users.noreply.github.com>
2022-12-14 19:07:04 +01:00
ze0s
716784e7a6
fix(filters): max downloads per hour check (#514)
* fix(filters): sqlite max downloads per hour

* fix(filters): missing import
2022-10-27 23:13:06 +02:00
ze0s
5183f7683a
feat(filters): filtering for raw releaseTags (#506)
feat(filters): add releaseTags filtering
2022-10-18 23:52:36 +02:00
ze0s
f5faf066a9
feat(filters): improve list view with filtering (#465) 2022-09-22 11:54:17 +02:00
ze0s
3a334121f7
feat(filters): support partial update (#409) 2022-08-15 15:54:34 +02:00
ze0s
5d80e48b54
feat(filters): add except origins (#396)
* feat(filters): add except origins

* feat(filters): add user origin
2022-08-03 12:47:32 +02:00
ze0s
2b3fab28c1
feat(filters): list actions count (#372) 2022-07-23 18:06:11 +02:00
ze0s
d56693cd33 feat(filters): add external script and webhook checks 2022-07-23 15:19:28 +02:00
Ludvig Lundgren
0e88117702
feat(logging); improve messages and errors (#336)
* feat(logger): add module context

* feat(logger): change errors package

* feat(logger): update tests
2022-07-05 13:31:44 +02:00
Ludvig Lundgren
f67c92340a
fix(filters): postgres dl limits check (#308) 2022-06-15 19:39:21 +02:00
Ludvig Lundgren
91b094f4f4
feat(confg): reload on save and refactor logging (#275)
* feat(confg): reload on save

* refactor(logging): rework
2022-05-20 09:27:01 +02:00
Ludvig Lundgren
2a23ed0185
feat(filters): add download limits (#266)
* feat(filters): add download limits
2022-05-18 14:14:13 +02:00
Ludvig Lundgren
e6c151a029
feat: improve release parsing and filtering (#257)
* feat(releases): improve parsing

* refactor: extend filtering add more tests

* feat: improve macro

* feat: add and remove fields

* feat: add freeleech percent to bonus

* feat: filter by origin
2022-04-30 13:43:51 +02:00
Ludvig Lundgren
3185832708
feat: add postgres support (#215)
* feat: add postgres support and refactor

* feat: improve releases find

* fix: autobrrctl create user
2022-04-02 19:24:23 +02:00
Ludvig Lundgren
cc0c071cce feat: wip postgres support 2022-03-27 03:12:00 +02:00
Ludvig Lundgren
8faf7ed410
fix(filters): load only from active indexers (#202) 2022-03-26 13:57:42 +01:00