Commit Graph

25 Commits

Author SHA1 Message Date
Keoni Mahelona b1bdd6d9be
feat(api): added filters on genre & md5 for files api (#3127)
### Description
Added filters for genre and md5 to the files API, e.g.
`/api/v2/files?genre=soul`

**This is a new feature**: Yes

**I have updated the documentation to reflect these changes**: No
There should be a schema and docs that are generated automatically. I
don't know where that is.


### Testing Notes

**What I did:**
- Used docker to deploy locally
- Confirmed filters work at
http://localhost:8080/api/v2/files?genre=Soul

**How you can replicate my testing:**
- `make clean dev`
- Upload some files!
- Visit http://localhost:8080/api/v2/files
- You can use the filters
<img width="658" alt="Screenshot 2024-12-23 at 01 36 01"
src="https://github.com/user-attachments/assets/ba19f7f3-fb3e-495d-8937-d451c70d326c"
/>
<img width="652" alt="Screenshot 2024-12-23 at 01 35 56"
src="https://github.com/user-attachments/assets/c7191131-a963-463a-b52f-9d0952192555"
/>

_How can the reviewer validate this PR?_
- See above
- wrote tests to confirm filters work
2025-01-08 16:54:53 +00:00
Thomas Göttgens 9757b1b78c
feat(api): implement file deletion (#2960)
This implements the file delete to the Django API. Previously, the code was only manipulating the database while leaving the file in place.

Co-authored-by: jo <ljonas@riseup.net>
2024-05-05 22:44:30 +02:00
Jonas L b2c1ceb89f
fix(api): paths with question marks chars are handled by X-Accel-Redirect (#2875)
Use the filepath_to_uri function instead.
2024-01-07 15:07:01 +01:00
Jonas L 72268ad9bb
fix(api): let nginx handle the media file content type (#2862) 2024-01-01 13:07:35 +01:00
Jonas L 0ce63f3bf0
fix(api): ensure non ascii paths are handled by X-Accel-Redirect (#2861) 2024-01-01 12:58:19 +01:00
Jonas L 4603c1759f
feat!: use nginx to serve media files (#2860)
Closes #2522

To reduce the strain on the API service, we moved the media file serving
to the Nginx web server. The API is still handling the authentication,
but delegates the serving using the `X-Accel-Redirect` header.

BREAKING CHANGE: The media file serving is now handled by Nginx instead
of the API service. The `storage.path` field is now used in the Nginx
configuration, so make sure to update the Nginx configuration file if
you change it.
2023-12-30 18:59:15 +01:00
jo 861698987c refactor: don't use f-string on logging statements
The strings are now be formatted if the logging level is enabled.
2023-02-26 19:09:51 +02:00
jo f5e46c6f3d feat: configure cue points analysis per track type 2023-02-15 10:13:32 +02:00
Jonas L e97b06496a
feat(api): don't use hyperlinked serializers (#1984) 2022-07-27 09:54:57 +02:00
Jonas L f08af1f3fa
feat(api): don't use trailing slashes (#1982) 2022-07-22 17:34:09 +02:00
jo 0e3ede5a1a chore(api): route using urls
Allow to register function views in the same app instead of globaly.
2022-07-19 19:52:54 +02:00
jo db976881f0 fix: use constrained foreign key for files track_type 2022-07-07 21:07:41 +02:00
Jonas L 703a8e5856
chore: remove cloud storage remainings (#1934) 2022-07-04 22:09:14 +02:00
Jonas L 2ce1053bbc
chore(api): rename library model visibility field (#1933) 2022-07-01 19:13:31 +02:00
jo f2e947f05f chore(api): rename file model fields
- Removed checksum field
- Removed ftype field
- Removed silan_check field
2022-06-29 13:51:07 +02:00
jo 05ca410453 feat(api): rename track type to library
Related to #1922

- rename library model fields
2022-06-29 13:51:07 +02:00
jo 7503618599 test(api): fix lint errors 2022-06-29 06:04:31 +02:00
jo 0a1406bf48 chore(api): fix import-outside-toplevel lint error 2022-06-29 06:04:31 +02:00
jo 70a31338f7 feat(api): create bulk_import command
- filter by allowed_extensions
2022-06-28 19:05:14 +02:00
jo 4009e7eeb6 chore(api): use fully qualified model names 2022-06-27 19:02:12 +02:00
jo ec8c18097d chore(api): fix some linting errors 2022-06-22 13:37:17 +02:00
jo 1e83a91b5e chore(api): use named argument for on_delete 2022-06-22 13:37:17 +02:00
jo f7bb6e7592 feat: move storage path setting to configuration file
- change default storage path to /srv/libretime
- remove music dirs table
- use /tmp for testing storage
- storage dir should always have a trailing slash
2022-06-08 23:23:08 +02:00
jo 0bbd46c33f refactor(api): fix pylint errors 2022-04-04 15:20:22 +02:00
Jonas L fce988aef1
feat(api): split api into multiple apps (#1626)
Fixes #1622

- split the api into 4 apps: core, history, schedule, storage
- exploded the settings into testing/prod
2022-04-04 14:38:50 +02:00