* fix some races in IRC handler management
* remove go 1.21 and slices package
* chore: update deps
* fix: use exp/slices pkg and client callbacks
* fix(irc): remove deadlock mutex from authenticate
* restore locking in authenticate()
* fix(irc): data races
* fix(irc): do not allow restart of disabled network
* fix(irc): disable restart btn if net disabled
---------
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
* fix(database): hot fix for deleting filter.
This fixes the no sql row set, no idea why it does that but removing the row check I added fixes it, Not sure if it affects others rowsAffected in the delete function.
* fix: imports
---------
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
* fix(web): truncate feed name and adjust margins
This is to avoid clipping on narrow screens.
Bug: https://i.imgur.com/Aw3FzRK.png
* fix(web): fix boundaries and layout on feed page
fix(web): align switches on download client, feed and notification page
* fix(web): add truncate and margin to feed names
* correct truncate
change margin to padding
* inherit text styles
---------
Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
Co-authored-by: Fabricio Silva <hi@fabricio.dev>
refactor: copylocks and staticcheck findings
Refactor mutex handling, optimize byte slice creation, and clean up code in accordance with go.staticcheck and copylocks guidelines.
- Changed AppConfig's mutex to *sync.Mutex, preventing mutex copying and enhancing thread safety.
- Simplified byte slice initialization in writeConfig for efficiency.
- Removed redundant return in DynamicReload for better code clarity.
* feat(feeds): add force run
* fix: simplify ForceRun
* add confirmation modal
* handle errors by using the test func
* require user input to run
* make sure to reschedule next job after forcerun
* refactor modal centering with grid
* refactor: Simplify startJob and forceRun logic
- Refactor `startJob` to accept a `runImmediately` flag. This flag controls whether the job should be run immediately or scheduled for later. This change simplifies the `ForceRun` function by allowing it to call `startJob` with `runImmediately` set to `true`.
- Remove redundant checks in `ForceRun` related to feed type. These checks are handled in `startJob`.
BREAKING CHANGE: The `startJob` function now requires a second argument, `runImmediately`. This change affects all calls to `startJob`.
* fix(web) Invalidate queries after forceRun
* refactor(feeds): init and test run
---------
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
* 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>
* chore: Add CODE_OF_CONDUCT
This would be great inorder to keep people on their best behavior when interacting with each other in this project.
* Update .dockerignore
* Update CODE_OF_CONDUCT.md
---------
Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
* factor out test helpers
* refactor, add tests for animebytes
* revert test refactor
* better name
* change format, migrate some examples
* migrated remaining test cases
* add comment about `Test` vs `Tests`
* refactor
* reorder expectations to match vars
* generate
* turn on strict unmarshalling, remove old `Test` from schema
* start modifying actual definitions
* done with the As
* Bs
* C, D
* E, F
* G, H, I, ... L
* M, N
* O, P
* R
* bonus error. without this, pattern/vars disagreement can panic.
* S
* T, U
* X.. Now we know our ABCs next time won't you sing with meeeee
* fix another test
* another driveby change
* be less strict parsing custom definitions
* fix(definitions): load custom definitions
---------
Co-authored-by: ze0s <ze0s@riseup.net>
* 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>
* feat(tests): Verify autobrr.com URLs
* test: drop body content check
* feat: Improved URL Scanning
* cleaned up comments
* refactor: enhance URL checker for readability and flexibility
- Introduce AutobrrURLChecker struct to group related variables and functions
- Replace ioutil.ReadFile with os.ReadFile for reading files
- Adjust HTTP client setup and request creation for better error handling
- Trim trailing slashes from URLs and deduplicate URLs before making requests
- Reduce sleep duration between requests to 500ms
* fix: move test into test/docs