Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Sort performers and studios by size of files on disk #5530

Open
ryosaeba75 opened this issue Dec 4, 2024 · 2 comments
Open

[Feature] Sort performers and studios by size of files on disk #5530

ryosaeba75 opened this issue Dec 4, 2024 · 2 comments

Comments

@ryosaeba75
Copy link

Is your feature request related to a problem? Please describe.
I'd like to be able to sort Performers and Studios by file size on disks. In particular for scenes, but It can be extended to gallery and images to.

Describe the solution you'd like
Right now you can sort by scene count/gallery count/image count, this feature would add, the following options "Scenes size on disk", "Galleries size on disk" and "Images size on disk" and would display the total size instead of the scene/gallery/image count in the card/row of the corresponding view

See the following examples :
Performer cards|200
Performer list|200
Studio cards|200

Describe alternatives you've considered
At least for the scenes (I don't really use gallery/image right now), I've made some graphql (with sql query) that will display performers/studios order by total file size but having it directly in the stash webui would be better.

Additional context
Add any other context or screenshots about the feature request here.

@ryosaeba75 ryosaeba75 changed the title [Feature] Short Form Title (50 chars or less.) [Feature] Sort performers and studios by size of files on disk Dec 4, 2024
@doneisenhower
Copy link

Hi there, I was searching for a similar feature and found your issue. Would you mind sharing your GraphQL query please?

@ryosaeba75
Copy link
Author

Hi there, I was searching for a similar feature and found your issue. Would you mind sharing your GraphQL query please?

Those are the query that I used. They are probably not perfect, but they do the job.

Filesize per performer:

{"query":"mutation ($sql: String!) {\n  querySQL(sql: $sql) {\n    columns\n    rows\n  }\n}","variables":{"sql":"SELECT sum(C.size)/(1024*1024*1024) as fileSize , E.name FROM scenes as A, scenes_files as B, files as C , performers_scenes AS D, performers as E WHERE A.id = B.scene_id AND B.file_id = C.id  AND A.id = D.scene_id AND E.id = D.performer_id GROUP BY D.performer_id ORDER BY fileSize DESC"},"operationName":null}

Filesize per studio

{"query":"mutation ($sql: String!) {\n  querySQL(sql: $sql) {\n    columns\n    rows\n  }\n}","variables":{"sql":"SELECT sum(C.size)/(1024*1024*1024) as fileSize , D.name FROM scenes as A, scenes_files as B, files as C , studios AS D WHERE A.id = B.scene_id AND B.file_id = C.id  AND A.studio_id = D.id GROUP BY D.id ORDER BY fileSize DESC"},"operationName":null}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants