Commit graph

55 commits

Author SHA1 Message Date
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
Kyle Sanderson
81ce8acb2b
fix(releases): search by group (#1876)
fix(search): regression on group
2024-12-12 13:56:04 +01:00
ze0s
f644b3a4d6
feat(filters): implement AnnounceType (#1837)
* feat(filters): implement AnnounceType

* fix: rss tests
2024-12-08 21:08:24 +01:00
ze0s
59c5858bf0
fix(releases): update size after actions run (#1809) 2024-11-06 18:55:00 +01:00
ze0s
fd90020400
feat(releases): show indexer name instead of identifier (#1706)
* feat(releases): show indexer name instead of identifier

* feat(releases): remove log in Cell

* feat(releases): update Dashboard recent releases

* fix(releases): db tests

* fix(releases): remove unused code

* fix(releases): remove more unused code

* fix(releases): remove even more unused code

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-09-03 14:57:48 +02:00
Kyle Sanderson
982f7ddf68
refactor(wildcard): optimize and add caching (#1634)
* fix(wildcard): avoid excessive allocations every loop

* are you going to Scarborough Fair?

* ruby ruby ruby ruby

* ride on, little murphy

* shirley?

* to the moon

* reggie are you there?

* code 99

* my doctorate is in Art History

* helps to be consistent

* tidy

* slow and steady gets the clam

* oysters were better anyway

* DIAL TONE
2024-09-02 11:18:14 +02:00
ze0s
acb91e8709
feat(http): implement missing findByID methods (#1635)
* feat(http): implement missing methods

* general cleanup
* unify param handling
* handle not found errors
* unify err handlers

* fix(http): fmt type
2024-08-29 12:22:03 +02:00
ze0s
accc875960
feat(database): improve error handling (#1633) 2024-08-29 09:00:53 +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
ze0s
3202c6043d
feat(indexers): update release baseurl on update (#1532) 2024-05-03 11:32:56 +02:00
soup
19e129e55f
feat(releases): delete based on age/indexer/status (#1522)
* feat(releases): delete based on age/indexer/status

* fix: sanitize releaseStatuses

* swap to RMSC

* add AgeSelect component

* improve texts

* refactor: streamline form layout

* improve text

* remove a paragraph

* improved UX

explaining the options, better error handling

* reinstate red border

* fix: labels to match other similar labels for selects

- improved contrast for the word "required" in desc
- added red asterisk to required select

* minor text improvement to warning

* fix: delete-button vertical alignment

* feat: cleanup queries

* feat: cleanup delete

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2024-05-03 11:32:20 +02:00
ze0s
3c3b47fa10
feat(macros): add IndexerName (#1511)
* feat(macros): add IndexerName

* fix: tests

* fix: tests
2024-04-16 17:35:17 +02:00
ze0s
9992675971
feat(releases): show details in list view (#1337)
* feat(releases): show details in list view

* fix(releases): activitytable columns type

* fix(releases): incognito mode

* feat(releases): move details button

* do we wanna truncate?

* fix(web): release column width at full size

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2024-01-02 21:53:38 +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
soup
3b60365483
feat(web): link Dashboard stats to Releases page (#1281)
* feat(web): link stats to release table

- added Errored Pushes
- Made Recent Activity same color as Stats

* feat(releasetable): made links a separate row

https://i.imgur.com/ZoAOrXP.png

remove comment

* added LinkIcon to StatsItem

- Changed grid-cols to 2, as we now have 4 for narrow widths

* fix linting

* move some text modifier to parent element

* feat: add scale on hover with transition

deduplicated some classes

* adapt gap between StatsItems for mobile
remove border and title on stats divs

---------

Co-authored-by: Fabricio Silva <hi@fabricio.dev>
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
2023-12-25 14:03:29 +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
ze0s
06b864da4d
fix(releases): search with postgres (#1181)
* fix(releases): search with postgres

* fix: validate release push status from filters

* fix: add missing import

* fix: validate push status if not empty
2023-10-16 20:27:15 +02:00
Kyle Sanderson
98df0c9040
chore(build): enable CodeQL (#1026)
* Create codeql.yml

* setup pnpm

* sq.Eq{"ras.status": params.Filters.PushStatus}

* enable extended and quality

* fix: code scanning alert #58 #57

https://github.com/autobrr/autobrr/security/code-scanning/58
https://github.com/autobrr/autobrr/security/code-scanning/57

* fix: linting issues for code scanning 60, 59, 56

https://github.com/autobrr/autobrr/security/code-scanning/60
https://github.com/autobrr/autobrr/security/code-scanning/59
https://github.com/autobrr/autobrr/security/code-scanning/56

---------

Co-authored-by: Fabricio Silva <hi@fabricio.dev>
2023-09-26 21:24:59 +02:00
Kyle Sanderson
28b13d6d24
fix(releases): improve search keyword specifiers (#1106)
fix(search): improve keyword specifiers.
2023-09-11 13:34:52 +02:00
Kyle Sanderson
0cd560d7f3
fix(releases): use case-insensitive searching (#1092)
* fix(web/search): use case-insensitive searching for releases

* to the moon
2023-09-09 12:33:07 +02:00
ze0s
1bfbe38335
feat(macros): add SizeString DownloadURL and InfoURL (#1080)
* feat(macro): add new variables

* SizeString
* DownloadURL
* InfoURL

* feat(macro): add new test cases
2023-09-03 13:27:47 +02:00
ze0s
668e1dbc35
fix(actions): missing data on retry (#1051)
* fix(actions): missing data on retry

* fix(releases): add missing field in get

* fix(actions): wrong field in scan
2023-08-18 00:20:15 +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
soup
e6f32596a1
fix(releases): delete older than X (#993)
* fix(release): DeleteOlder func for zero duration

resolves a bug in the `DeleteOlder` function where recent 24-hour data wasn't deleted when set to `delete everything`. We now correctly set the olderThanTimestamp to a future date when duration is zero, ensuring complete deletion of all records.

* fix(releases): delete older

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-07-22 14:49:28 +02:00
soup
f774831d76
feat(releases): delete older than x (#924)
* feat: delete releases older than x

* check timestamp

* incomplete front end changes

commiting changes from codespace to not lose them

* change to dropdown with options

* using int comparisons to avoid nightmares

* Revert "using int comparisons to avoid nightmares"

This reverts commit dc55966a73e9f6ad79ed28c3a3e0dbe0e35448a6.

* suggestions by stacksmash76

come back to discord @stacksmash76

* Curves - a touch of warmth in our pixel realm

* replace inline css with tailwind

* remove unnecessary comment

* align label with dropdown
changed first paragraph to something more sensible

* change font weight for duration label

* padding changes

* nitpicky

* merged divs where possible

* small adjustments for light theme

* attempt to fix for postgres

* refactor: split into component and add confirmation modal

also restyle component

* fix: go fmt

---------

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
2023-05-21 18:39:28 +02:00
ze0s
6898ad8315
feat(releases): replay actions (#932)
* feat(releases): replay actions

* feat(releases): replay actions component

* fix: update filter actions

* fix: select filter_id from ras
2023-05-15 21:30:04 +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
ze0s
4c83787a0b
feat(releases): add info url link to releases list (#683)
* feat(indexers): definitions add infourl to irc parsing

* feat(indexers): add infourl to releases

* fix(indexers): fix info urls

* fix(indexers): update btn
2023-01-29 21:40:49 +01:00
ze0s
21c02dfab0
fix(filters): max downloads per filter check (#660) 2023-01-18 21:47:27 +01:00
ze0s
9fbd592adc
fix(releases): table sorting (#603)
fix(releases): data sorting
2023-01-01 16:35:21 +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
Kyle Sanderson
0f3ce7573e
fix(releases): improve load time by 47x (#565)
* fix(releases): improve load time by 47x

* fix(releases): optimize stats query

* remove the *

* change nil to actual 0

* feat(releases): flip recent to orderby id

* fix(stats): make postgres compatible

* return the * to COUNT for pgsql

Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
Co-authored-by: ze0s <ze0s@riseup.net>
2022-12-16 11:43:09 -08:00
Kyle Sanderson
5260777b6b
feat(releases): implement keyword search (#564)
* feat(releases): implement reserved keyword search

* implement filter / hdr

* implement quote support

* implement wildcard for decimals

* feat(release): specify table name in map
2022-12-14 19:20:47 +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
Ludvig Lundgren
31fbe013ff
feat(releases): action status show filter and client (#338)
* feat(releases): action status show client and filter

* feat(releases): add better tooltip
2022-07-06 17:30:41 +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
258754643d
feat(web): search releases (#302)
* feat(releases): search in ui

* refactor(releases): optimize query recent releases
2022-06-14 01:51:33 +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
b7d1f216c0
fix(feeds): ttl and correct field types (#259) 2022-05-01 16:09:00 +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
3b43ccba8a
feat: delete all releases from settings (#170) 2022-03-06 18:08:32 +01:00
Ludvig Lundgren
246e3ddc26
feat(web): releases list filtering (#136) 2022-02-19 20:00:48 +01:00
Ludvig Lundgren
00bc8298ac
feat(filters): add music filters (#91)
* feat(filters): add music filters

* feat: improve parsing and filtering

* feat: add red api support
2022-01-19 18:50:04 +01:00