Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .golangci.bck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# options for analysis running
run:
timeout: 5m

linters:
disable-all: true
enable:
# Default set of linters from golangci-lint
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
# Linters added by the stash project.
# - contextcheck
- copyloopvar
- dogsled
- errchkjson
- errorlint
# - exhaustive
- gocritic
# - goerr113
- gofmt
# - gomnd
# - ifshort
- misspell
# - nakedret
- noctx
- revive
- rowserrcheck
- sqlclosecheck

# Project-specific linter overrides
linters-settings:
gofmt:
simplify: false

errorlint:
# Disable errorf because there are false positives, where you don't want to wrap
# an error.
errorf: false
asserts: true
comparison: true

revive:
ignore-generated-header: true
severity: error
confidence: 0.8
rules:
- name: blank-imports
disabled: true
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: if-return
disabled: true
- name: increment-decrement
- name: var-naming
disabled: true
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
disabled: true
- name: indent-error-flow
disabled: true
- name: errorf
- name: empty-block
disabled: true
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id

rowserrcheck:
packages:
- github.com/jmoiron/sqlx
149 changes: 74 additions & 75 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,87 +1,86 @@
# options for analysis running
run:
timeout: 5m

version: "2"
linters:
disable-all: true
default: none
enable:
# Default set of linters from golangci-lint
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
# Linters added by the stash project.
# - contextcheck
- copyloopvar
- dogsled
- errcheck
- errchkjson
- errorlint
# - exhaustive
- gocritic
# - goerr113
- gofmt
# - gomnd
# - ifshort
- govet
- ineffassign
- misspell
# - nakedret
- noctx
- revive
- rowserrcheck
- sqlclosecheck

# Project-specific linter overrides
linters-settings:
gofmt:
simplify: false

errorlint:
# Disable errorf because there are false positives, where you don't want to wrap
# an error.
errorf: false
asserts: true
comparison: true

revive:
ignore-generated-header: true
severity: error
confidence: 0.8
rules:
- name: blank-imports
disabled: true
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: if-return
disabled: true
- name: increment-decrement
- name: var-naming
disabled: true
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
disabled: true
- name: indent-error-flow
disabled: true
- name: errorf
- name: empty-block
disabled: true
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id

rowserrcheck:
packages:
- github.com/jmoiron/sqlx
- staticcheck
- unused
settings:
errorlint:
errorf: false
asserts: true
comparison: true
revive:
confidence: 0.8
severity: error
rules:
- name: blank-imports
disabled: true
- name: context-as-argument
- name: context-keys-type
- name: dot-imports
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
disabled: true
- name: if-return
disabled: true
- name: increment-decrement
- name: var-naming
disabled: true
- name: var-declaration
- name: package-comments
- name: range
- name: receiver-naming
- name: time-naming
- name: unexported-return
disabled: true
- name: indent-error-flow
disabled: true
- name: errorf
- name: empty-block
disabled: true
- name: superfluous-else
- name: unused-parameter
disabled: true
- name: unreachable-code
- name: redefines-builtin-id
rowserrcheck:
packages:
- github.com/jmoiron/sqlx
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
settings:
gofmt:
simplify: false
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
43 changes: 43 additions & 0 deletions docs/dev/AUDIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Audio Datatype

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


- This ticket adds backend support for Audio Only, future tickets can add the UI elements
- Audio metadata:
- Title
- Artists (string? like director)
- Date
- Studio
- Performers
- Tags
- Details
- Urls
- Rating
- Organized
- O History
- Play History
- Studio Code
- NICE TO HAVES
- Groups
- Audio File metadata:
- duration
- audio codec
- FUTURE (to be considered at a later date)
- 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.

- bitrate
- sample rate


## TODO List

- [ ] `pkg/sqlite/migrations/86_audio.up.sql`
- Create a migration for the Audio type, very similar to Scene
- [ ] Duplicate much of `pkg/scene/*` into `pkg/audio/*`
- Exclude: markers, screenshot, preview, transcode, sprite
- [ ] Graphql
- [ ] Copy/modify `graphql/schema/types/scene.graphql` to `graphql/schema/types/audio.graphql`

### Last Steps
- [ ] Delete this file upon completion of the feature
9 changes: 9 additions & 0 deletions gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ models:
fieldName: DurationFinite
frame_rate:
fieldName: FrameRateFinite
AudioFile:
fields:
# override float fields - #1572
duration:
fieldName: DurationFinite
sample_rate:
fieldName: SampleRateFinite
# movie is group under the hood
Movie:
model: github.com/stashapp/stash/pkg/models.Group
Expand Down Expand Up @@ -96,6 +103,8 @@ models:
model: github.com/stashapp/stash/internal/manager.StashBoxBatchTagInput
SceneStreamEndpoint:
model: github.com/stashapp/stash/internal/manager.SceneStreamEndpoint
AudioStreamEndpoint:
model: github.com/stashapp/stash/internal/manager.AudioStreamEndpoint
ExportObjectTypeInput:
model: github.com/stashapp/stash/internal/manager.ExportObjectTypeInput
ExportObjectsInput:
Expand Down
2 changes: 2 additions & 0 deletions graphql/schema/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# TODO(audio): add findAudio, findAudios, audioCreate, audioUpdate, audioDestroy, audiosDestroy

"The query root for this schema"
type Query {
# Filters
Expand Down
Loading
Loading