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] Add fields director and (studio) code to scenes #3051

Merged
merged 16 commits into from
Nov 7, 2022

Conversation

HappyAxolotl
Copy link
Contributor

@HappyAxolotl HappyAxolotl commented Oct 25, 2022

General

This PR adds the fields code and director to Scene objects in relation to #2359 to be inline with stash-box (cc @stg-annon). This is the first time I've worked with go, graphql and react, so I appreciate any feedback!

Changes

  • added the fields code and director to Scene objects
  • added locales scene_code ("Studio Code")
  • scrape scene fields code and director from stash-box sources
  • added all new fields to import/export functionality
  • added filters and sort criteria for all new fields

The fields code and director are using the same datatypes and semantics as stash-box:

Show details
stash-box=# \d scenes
                            Table "public.scenes"
    Column     |            Type             | Collation | Nullable | Default 
---------------+-----------------------------+-----------+----------+---------
 id            | uuid                        |           | not null | 
 title         | character varying(255)      |           |          | 
 details       | text                        |           |          | 
 date          | date                        |           |          | 
 studio_id     | uuid                        |           |          | 
 created_at    | timestamp without time zone |           | not null | 
 updated_at    | timestamp without time zone |           | not null | 
 duration      | integer                     |           |          | 
 director      | text                        |           |          | 
 deleted       | boolean                     |           | not null | false
 code          | text                        |           |          | 
 date_accuracy | character varying(10)       |           |          | 

Screenshots

Scene panels

SceneEditPanel

image

SceneDetailPanel

image

Scraping Scrape studio code (`c032ebb9-22e4-440b-9453-5c50cd8e8843`):

image

Scrape director (7d54e4ec-33fe-467e-b642-db4990bb044f):

image

@djbtwothousandtwenty
Copy link

This is awesome, could you also add the Director field (or maybe Photographer might be better suited) to Galleries? I know i have a bunch of favorite photographers, and no way to really track them in the stash currently, except for creating custom tags and applying those. Having a dedicated field might be a great addition for that. networks like metart, but also metadata sites like thenude also have this information, so editing the scrapers to also include/fill those fields would be possible then as well

@HappyAxolotl
Copy link
Contributor Author

@djbtwothousandtwenty that's a good idea but it's a bit out of scope for this PR. I'd like to keep this PR as small and simple as possible since this is my first contribution to this project. Depending on the feedback I'll keep that in mind for a second PR.

@HappyAxolotl
Copy link
Contributor Author

HappyAxolotl commented Oct 26, 2022

Submitted a PR to stash-box to allow the submission of the fields director and (studio) code to scene drafts: stashapp/stash-box#544

@HappyAxolotl
Copy link
Contributor Author

Removing the draft status as this PR is ready to review. Just expect an error message from stash-box when submitting a scene, this will be fixed by stashapp/stash-box#544
image

@HappyAxolotl HappyAxolotl marked this pull request as ready for review October 27, 2022 16:56
@WithoutPants
Copy link
Collaborator

Static code review looks good. Haven't tested yet. If you want this merged in the nearer term, I'd suggest splitting out the stash-box submission stuff and putting that into a separate, subsequent PR so that submissions don't fail while we wait for the equivalent stash-box updates to be pushed through to stashdb.

@WithoutPants WithoutPants added the feature Pull requests that add a new feature label Oct 28, 2022
@WithoutPants WithoutPants added this to the Version 0.18.0 milestone Oct 28, 2022
@HappyAxolotl
Copy link
Contributor Author

That's a good idea, I've removed the commit 07efc17 which introduced the change of the stash-box submission schema and will file a separate PR for this. I've also incremented the appSchemaVersion from 37 to 38 in respect to #1922

@WithoutPants
Copy link
Collaborator

Export/import isn't including the new fields.

I think filtering criteria should be included for the new fields.

@Foucoubou
Copy link
Contributor

@HappyAxolotl - the stash-box counterpart seems to be merged - stashapp/stash-box#544
:)

@HappyAxolotl
Copy link
Contributor Author

@Foucoubou Thanks for the info! However, since no new version of stash-box has been released yet and the changes have not yet been deployed to stashdb afaik, I'd like to keep that separate from this PR so this can be merged for the 0.18.0 release hopefully

@HappyAxolotl
Copy link
Contributor Author

Sorry this just got a bit messy but I decided to include the change for galleries to add a photographer field as this requires a schema migration as well.

Export/import isn't including the new fields.

Those were added for all new fields.

I think filtering criteria should be included for the new fields.

I've also added filters and sort criteria for all new fields.

These are definitively the last changed for this PR, it's now ready for a second review

@HappyAxolotl HappyAxolotl changed the title [Feature] Add fields director and (studio) code to scenes [Feature] Add fields director & (studio) code to scenes and photographer to galleries Nov 2, 2022
@WithoutPants
Copy link
Collaborator

The gallery changes should be in a separate PR.

@HappyAxolotl
Copy link
Contributor Author

removed the commits 957ed21, 7eb81a0, 8e93591 and a9d0fc6 that introcuced the gallery changes

@HappyAxolotl HappyAxolotl changed the title [Feature] Add fields director & (studio) code to scenes and photographer to galleries [Feature] Add fields director and (studio) code to scenes Nov 2, 2022
@@ -39,6 +39,7 @@ const sortByOptions = [
"interactive",
"interactive_speed",
"perceptual_similarity",
"code",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be scene_code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with ListFilterOptions is that it'll set the value as messageID. So it will either display the correct messageID but fail the query as the database field is called code and not scene_code or it will display the value because code is not a valid messageID. With my very limited React knowledge I couldn't find a solution to this so I decided to remove the sort by scene code option entirely in 66043ff.

ui/v2.5/src/models/list-filter/scenes.ts Outdated Show resolved Hide resolved
ui/v2.5/src/models/list-filter/criteria/factory.ts Outdated Show resolved Hide resolved
@WithoutPants WithoutPants merged commit eff86bf into stashapp:develop Nov 7, 2022
@HappyAxolotl HappyAxolotl deleted the scenes-director-and-code branch November 7, 2022 09:11
@JanJastrow
Copy link

JanJastrow commented Nov 7, 2022

Hi, thanks for this PR.
I think this is not fully working with pulling data from StashDB yet.
I re-pulled a scene from StashDB that has a director (Director: Pat Myne) and this info did not show up in the Tagger View nor was the information added to my local scene after I clicked 'Save'.
Screenshot 2022-11-07 at 18 07 17


Edit:
I also submitted a scene with Studio Code from Stash to StashDB and it was not transfered.
I don't know if that is a Stash or StashDB issue.

@WithoutPants
Copy link
Collaborator

Hi, thanks for this PR. I think this is not fully working with pulling data from StashDB yet. I re-pulled a scene from StashDB that has a director (Director: Pat Myne) and this info did not show up in the Tagger View nor was the information added to my local scene after I clicked 'Save'.

Fixed in #3094

Edit: I also submitted a scene with Studio Code from Stash to StashDB and it was not transfered. I don't know if that is a Stash or StashDB issue.

The stash-box submission functionality is waiting on the stashdb instance to be updated.

@YurikaL YurikaL mentioned this pull request Dec 7, 2022
@WithoutPants WithoutPants linked an issue Dec 7, 2022 that may be closed by this pull request
@DogmaDragon
Copy link
Collaborator

That's a good idea, I've removed the commit 07efc17 which introduced the change of the stash-box submission schema and will file a separate PR for this. I've also incremented the appSchemaVersion from 37 to 38 in respect to #1922

The new stash-box version was released. Could you create a PR for 07efc17 now?

@HappyAxolotl
Copy link
Contributor Author

@DogmaDragon thanks for the hint, I've opened #3335 for this

@DogmaDragon DogmaDragon linked an issue Jan 13, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull requests that add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add director field to scenes [Feature] Add Scene code
6 participants