Skip to content

Audio Backend#6824

Draft
bob12224 wants to merge 4 commits intostashapp:developfrom
bob12224:audio
Draft

Audio Backend#6824
bob12224 wants to merge 4 commits intostashapp:developfrom
bob12224:audio

Conversation

@bob12224
Copy link
Copy Markdown
Contributor

@bob12224 bob12224 commented Apr 13, 2026

This is a copy-paste setup for the backend to support AUDIO, similar to how Scene's and Images are handled.

The files allow for easy reference for discussion to agree on acceptable MVP.

Please see the docs/dev/AUDIO.md for the SCOPE and as a place for general discussion.

Relates to: #1258

Comment thread docs/dev/AUDIO.md

The `Audio` datatype is similar to `Scene` but stores audio-only media (i.e. Audiobooks, music, ASMR, etc).

## Scope
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gykes / @WithoutPants : You can see a limited scope here. The database design pkg/sqlite/migrations/86_audio.up.sql shows the extent of the change.

If I get a thumbs up, then I will start work. If you want to increase/reduce scope, or to wait for any other PRs, let me know here

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should nail down where this is planning on going. XXX vs non XXX

I prefer the former as that's what this app is kind of aimed at. If we do XXX then I believe that having Performer and Artist in the audio metadata would be confusing and would conflict. I say we just roll with what we currently have and not add Artists.

Copy link
Copy Markdown
Contributor Author

@bob12224 bob12224 Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am okay with all suggested changes.

Still waiting for some confirmation that the scope will be accepted before investing time into this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gykes if you feel comfortable giving the thumbs up on this, then I can go ahead.

For all of your suggestions, I placed a 👍 to indicate that I agree and will make the change once I start working.

I will be using this for SFW, but don't mind building it for NSFW. I will adopt all your suggestions (except the rating100, see PR comment to discuss)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the fact that the main dev has said it's okay in previous comments and casually in passing then I'm okay giving the thumbs up. I can test/review as you go or in chunks, whatever you are more comfortable doing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gykes this will be a large PR, if you want to provide reviews as commits come, or wait till the end; whatever you think is best to ensure this gets merged. I am also open to excluding/deferring sections to reduce the PR size

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just give me a ping when you feel it's ready for a review/test

Copy link
Copy Markdown
Collaborator

@Gykes Gykes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to preface this by saying I'm not the main dev and, quite frankly, have limited experience with design implementation so take what I say with a grain of salt. If something sounds dumb or wrong it probably is and feel free to call me on it.

Comment thread docs/dev/AUDIO.md

The `Audio` datatype is similar to `Scene` but stores audio-only media (i.e. Audiobooks, music, ASMR, etc).

## Scope
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should nail down where this is planning on going. XXX vs non XXX

I prefer the former as that's what this app is kind of aimed at. If we do XXX then I believe that having Performer and Artist in the audio metadata would be confusing and would conflict. I say we just roll with what we currently have and not add Artists.

Comment thread docs/dev/AUDIO.md
- duration
- audio codec
- OPTIONAL (can be added now or later)
- channels (mono, stereo, 5.1, 7.1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would tthis really be needed? Currently scenes have audio and we don't track this at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest looking at bitrate again, as this is tracked for scenes (the video portion).
And it might be better to add now, instead of planning to add later.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly I was referring to the channels. I think bitrate would be fine.

Comment thread pkg/sqlite/migrations/86_audio.up.sql Outdated
`created_at` datetime not null,
`updated_at` datetime not null,
`code` text,
`artists` text,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we decide to go with performers this would need to be changed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread pkg/sqlite/migrations/86_audio.up.sql Outdated
`updated_at` datetime not null,
`code` text,
`artists` text,
`album` text,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Studio was in the Audio Metadata but album is used here. How and where would we store albums? In the case of audio, studios seem like the best fit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

`title` varchar(255),
`details` text,
`date` date,
`rating` tinyint,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probs better to use rating100 similar to scenes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the migrations for scenes uses rating (ref: pkg/sqlite/migrations/1_initial.up.sql). I can only find rating100 in the graphql, which I do provide in graphql/schema/types/audio.graphql (line 51)

Comment thread pkg/sqlite/migrations/86_audio.up.sql Outdated
foreign key(`audio_id`) references `audios`(`id`) on delete cascade,
PRIMARY KEY("group_id", `audio_id`)
);
CREATE INDEX `index_movies_audios_on_movie_id` on "groups_audios" ("group_id");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misnamed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to index_group_audios_on_group_id

@rezreal
Copy link
Copy Markdown

rezreal commented Apr 16, 2026

tbh there is no reason why audios should not just be scenes and why there would be a dedicated section for them.

Lots of errors to fix and TODO notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants