11 Commits

Author SHA1 Message Date
Thomas Göttgens
643504edc9
fix(api): file upload with library (#3213)
Some checks failed
Container / meta (analyzer) (push) Waiting to run
Container / meta (api) (push) Waiting to run
Container / meta (legacy) (push) Waiting to run
Container / meta (nginx) (push) Waiting to run
Container / meta (playout) (push) Waiting to run
Container / meta (worker) (push) Waiting to run
Container / build (push) Blocked by required conditions
Project / pre-commit (push) Waiting to run
Project / test-tools (push) Waiting to run
Release-Please / release-please (push) Waiting to run
API schema / check (push) Has been cancelled
API schema / dispatch (push) Has been cancelled
API / lint (push) Has been cancelled
API / test-with-database (bullseye) (push) Has been cancelled
API / test-with-database (focal) (push) Has been cancelled
API / test-with-database (jammy) (push) Has been cancelled
Legacy / lint (7.4) (push) Has been cancelled
Legacy / test (7.4) (push) Has been cancelled
Legacy / locale (push) Has been cancelled
### Description

Uploads with bulk_import defining --library fail with error 400 in the
REST API

The primary key of the track_type was changed from chars to a numerical
ID, and the data model expects this now in the REST endpoint. However
the bulk import still populates this field with the Char Tag.

### Testing Notes

**What I did:**

`libretime-api bulk_import --path /home/libretime/upload/ --library POD
--allowed-extensions mp3`

**How you can replicate my testing:**

see above

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-19 12:38:04 +02:00
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
f08af1f3fa
feat(api): don't use trailing slashes (#1982) 2022-07-22 17:34:09 +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
70a31338f7 feat(api): create bulk_import command
- filter by allowed_extensions
2022-06-28 19:05:14 +02:00
jo
ec8c18097d chore(api): fix some linting errors 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