Commit graph

317 commits

Author SHA1 Message Date
7dJx1qP
e961ba4459
Fix tag hierarchy validation (#1926)
* update tag hierarchy validation
* refactor MergeHierarchy
* update tag hierarchy error message
* rename tag hierarchy function
* add tag path to error message
* Rename EnsureHierarchy to ValidateHierarchy

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-11-07 09:33:46 +11:00
WithoutPants
0f64954e5b
Identify task (#1839)
* Add identify task
* Change type naming
* Debounce folder select text input
* Add generic slice comparison function
2021-10-28 14:25:17 +11:00
kermieisinthehouse
5de06d4b62
Convert filesize to float64 for arm32 (#1895)
* Convert filesize to float64 for arm32
2021-10-27 11:55:11 +11:00
kermieisinthehouse
4dd56c3d82
Show duration and filesize in results (#1776)
* Add new query interface
* Refactor query builder
* Change Query interface
* Return duration and filesize in scene query
* Adjust UI for scene metadata
* Introduce new image query interface
* Change image Query interface
* Add megapixels and size to image query
* Update image UI

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-10-25 11:40:13 +11:00
SmallCoccinelle
e14bb8432c
Enable gocritic (#1848)
* Don't capitalize local variables

ValidCodecs -> validCodecs

* Capitalize deprecation markers

A deprecated marker should be capitalized.

* Use re.MustCompile for static regexes

If the regex fails to compile, it's a programmer error, and should be
treated as such. The regex is entirely static.

* Simplify else-if constructions

Rewrite

   else { if cond {}}

to

   else if cond {}

* Use a switch statement to analyze formats

Break an if-else chain. While here, simplify code flow.

Also introduce a proper static error for unsupported image formats,
paving the way for being able to check against the error.

* Rewrite ifElse chains into switch statements

The "Effective Go" https://golang.org/doc/effective_go#switch document
mentions it is more idiomatic to write if-else chains as switches when
it is possible.

Find all the plain rewrite occurrences in the code base and rewrite.
In some cases, the if-else chains are replaced by a switch scrutinizer.
That is, the code sequence

  if x == 1 {
      ..
  } else if x == 2 {
      ..
  } else if x == 3 {
      ...
  }

can be rewritten into

  switch x {
  case 1:
    ..
  case 2:
    ..
  case 3:
    ..
  }

which is clearer for the compiler: it can decide if the switch is
better served by a jump-table then a branch-chain.

* Rewrite switches, introduce static errors

Introduce two new static errors:

* `ErrNotImplmented`
* `ErrNotSupported`

And use these rather than forming new generative errors whenever the
code is called. Code can now test on the errors (since they are static
and the pointers to them wont change).

Also rewrite ifElse chains into switches in this part of the code base.

* Introduce a StashBoxError in configuration

Since all stashbox errors are the same, treat them as such in the code
base. While here, rewrite an ifElse chain.

In the future, it might be beneifical to refactor configuration errors
into one error which can handle missing fields, which context the error
occurs in and so on. But for now, try to get an overview of the error
categories by hoisting them into static errors.

* Get rid of an else-block in transaction handling

If we succesfully `recover()`, we then always `panic()`. This means the
rest of the code is not reachable, so we can avoid having an else-block
here.

It also solves an ifElse-chain style check in the code base.

* Use strings.ReplaceAll

Rewrite

    strings.Replace(s, o, n, -1)

into

    strings.ReplaceAll(s, o, n)

To make it consistent and clear that we are doing an all-replace in the
string rather than replacing parts of it. It's more of a nitpick since
there are no implementation differences: the stdlib implementation is
just to supply -1.

* Rewrite via gocritic's assignOp

Statements of the form

    x = x + e

is rewritten into

    x += e

where applicable.

* Formatting

* Review comments handled

Stash-box is a proper noun.

Rewrite a switch into an if-chain which returns on the first error
encountered.

* Use context.TODO() over context.Background()

Patch in the same vein as everything else: use the TODO() marker so we
can search for it later and link it into the context tree/tentacle once
it reaches down to this level in the code base.

* Tell the linter to ignore a section in manager_tasks.go

The section is less readable, so mark it with a nolint for now. Because
the rewrite enables a ifElseChain, also mark that as nolint for now.

* Use strings.ReplaceAll over strings.Replace

* Apply an ifElse rewrite

else { if .. { .. } } rewrite into else if { .. }

* Use switch-statements over ifElseChains

Rewrite chains of if-else into switch statements. Where applicable,
add an early nil-guard to simplify case analysis. Also, in
ScanTask's Start(..), invert the logic to outdent the whole block, and
help the reader: if it's not a scene, the function flow is now far more
local to the top of the function, and it's clear that the rest of the
function has to do with scene management.

* Enable gocritic on the code base.

Disable appendAssign for now since we aren't passing that check yet.

* Document the nolint additions

* Document StashBoxBatchPerformerTagInput
2021-10-18 14:12:40 +11:00
WithoutPants
39fdde273d
Scan refactor (#1816)
* Add file scanner
* Scan scene changes
* Split scan files
* Generalise scan
* Refactor ffprobe
* Refactor ffmpeg encoder
* Move scene scan code to scene package
* Move matchExtension to utils
* Refactor gallery scanning
* Refactor image scanning
* Prevent race conditions on identical hashes
* Refactor image thumbnail generation
* Perform count concurrently
* Allow progress increment before total set
* Make progress updates more frequent
2021-10-15 10:39:48 +11:00
WithoutPants
46ae4581b8
Refactor clean task (#1805)
* Refactor clean task
* Use path sorting for scenes and galleries
* Add changelog
2021-10-11 16:45:24 +11:00
gitgiggety
be94e52f21
Add movie count to performer and studio card (#1760)
* Add movies and movie_count properties to Performer type

Extend the GraphQL API to allow getting the movies and movie count by
performer.

* Add movies count to performer card

* Add movies and movie_count properties to Studio type

Extend the GraphQL API to allow getting the movies and movie count by
studio.

* Add movies count to studio card
2021-09-27 11:31:49 +10:00
SmallCoccinelle
a9e2a590b2
Lint checks phase 2 (#1747)
* Log 3 unchecked errors

Rather than ignore errors, log them at
the WARNING log level.

The server has been functioning without these, so assume they are not at
the ERROR level.

* Log errors in concurrency test

If we can't initialize the configuration, treat the test as a failure.

* Undo the errcheck on configurations for now.

* Handle unchecked errors in pkg/manager

* Resolve unchecked errors

* Handle DLNA/DMS unchecked errors

* Handle error checking in concurrency test

Generalize config initialization, so we can initialize a configuration
without writing it to disk.

Use this in the test case, since otherwise the test fails to write.

* Handle the remaining unchecked errors

* Heed gosimple in update test

* Use one-line if-initializer statements

While here, fix a wrong variable capture error.

* testing.T doesn't support %w

use %v instead which is supported.

* Remove unused query builder functions

The Int/String criterion handler functions are now generalized.

Thus, there's no need to keep these functions around anymore.

* Mark filterBuilder.addRecursiveWith nolint

The function is useful in the future and no other refactors are looking
nice.

Keep the function around, but tell the linter to ignore it.

* Remove utils.Btoi

There are no users of this utility function

* Return error on scan failure

If we fail to scan the row when looking for the
unique checksum index, then report the error upwards.

* Fix comments on exported functions

* Fix typos

* Fix startup error
2021-09-23 17:15:50 +10:00
gitgiggety
04e5ac9c2f
Studio aliases (#1660)
* Add migration to create studio aliases table
* Refactor studioQueryBuilder.Query to use filterBuilder
* Expand GraphQL API with aliases support for studio
* Add aliases support for studios to the UI
* List aliases in details panel
* Allow editing aliases in edit panel
* Add 'aliases' filter when searching
* Find studios by alias in filter / select
* Add auto-tagging based on studio aliases
* Support studio aliases for filename parsing
* Support importing and exporting of studio aliases
* Search for studio alias as well during scraping
2021-09-09 18:13:42 +10:00
gitgiggety
c91ffe1e58
Tag hierarchy (#1519)
* Add migration script for tag relations table
* Expand hierarchical filter features

Expand the features of the hierarchical multi input filter with support
for using a relations table, which only has parent_id and child_id
columns, and support adding an additional intermediate table to join on,
for example for scenes and tags which are linked by the scenes_tags
table as well.

* Add hierarchical filtering for tags
* Add hierarchical tags support to scene markers

Refactor filtering of scene markers to filterBuilder and in the process
add support for hierarchical tags as well.

* List parent and child tags on tag details page
* Support setting parent and child tags

Add support for setting parent and child tags during tag creation and
tag updates.

* Validate no loops are created in tags hierarchy
* Update tag merging to support tag hierarcy
* Add unit tests for tags.EnsureUniqueHierarchy
* Fix applying recursive to with clause

The SQL `RECURSIVE` of a `WITH` clause only needs to be applied once,
imediately after the `WITH`. So this fixes the query building to do just
that, automatically applying the `RECURSIVE` keyword when any added with
clause is added as recursive.

* Rename hierarchical root id column
* Rewrite hierarchical filtering for performance

Completely rewrite the hierarchical filtering to optimize for
performance. Doing the recursive query in combination with a complex
query seems to break SQLite optimizing some things which means that the
recursive part might be 2,5 second slower than adding a static
`VALUES()` list. This is mostly noticable in case of the tag hierarchy
where setting an exclusion with any depth (or depth: all) being applied
has this performance impact of 2,5 second. "Include" also suffered this
issue, but some rewritten query by joining in the *_tags table in one
pass and applying a `WHERE x IS NOT NULL` filter did seem to optimize
that case. But that optimization isn't applied to the `IS NULL` filter
of "exclude". Running a simple query beforehand to get all (recursive)
items and then applying them to the query doesn't have this performance
penalty.

* Remove UI references to child studios and tags
* Add parents to tag export
* Support importing of parent relationship for tags
* Assign stable ids to parent / child badges
* Silence Apollo warning on parents/children fields on tags

Silence warning triggered by Apollo GraphQL by explicitly instructing it
to use the incoming parents/children values. By default it already does
this, but it triggers a warning as it might be unintended that it uses
the incoming values (instead of for example merging both arrays).
Setting merge to false still applies the same behaviour (use only
incoming values) but silences the warning as it's explicitly configured
to work like this.

* Rework detecting unique tag hierarchy

Completely rework the unique tag hierarchy to detect invalid hierarchies
for which a tag is "added in the middle". So when there are tags A <- B
and A <- C, you could previously edit tag B and add tag C as a sub tag
without it being noticed as parent A being applied twice (to tag C).
While afterwards saving tag C would fail as tag A was applied as parent
twice. The updated code correctly detects this scenario as well.

Furthermore the error messaging has been reworked a bit and the message
now mentions both the direct parent / sub tag as well as the tag which
would results in the error. So in aboves example it would now show the
message that tag C can't be applied because tag A already is a parent.

* Update relations on cached tags when needed

Update the relations on cached tags when a tag is created / updated /
deleted so these always reflect the correct state. Otherwise (re)opening
a tag might still show the old relations untill the page is fully
reloaded or the list is navigated. But this obviously is strange when
you for example have tag A, create or update tag B to have a relation to
tag A, and from tags B page click through to tag A and it doesn't show
that it is linked to tag B.
2021-09-09 14:58:43 +10:00
WithoutPants
4625e1f955
Unify scrape refactor (#1630)
* Unify scraped types
* Make name fields optional
* Unify single scrape queries
* Change UI to use new interfaces
* Add multi scrape interfaces
* Use images instead of image
2021-09-07 11:54:22 +10:00
FleetingOrchard
50cb6a9c79
Add duration statistics to stats page (#1626) 2021-08-26 13:37:08 +10:00
WithoutPants
f52bfae8ac
Set stash id during performer scrape (#1608) 2021-08-04 09:33:21 +10:00
Jekora
ede8cca631
[Feature] Better resolution search (#1568)
* Fix width in database test setup
* Added more filters on resolution field
* added test to verify resolution range is defined for every resolution
* Refactor UI code

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-08-02 13:22:39 +10:00
WithoutPants
dc7584d77e
Saved filters (#1474)
* Refactor list filter
* Filter/criterion refactor
* Rename option value to type
* Remove None from options
* Add saved filter button
* Integrate default filters
2021-06-16 14:53:32 +10:00
WithoutPants
4fe4da6c01
Merge tags functionality (#1481)
* Add API to merge tags

Add new API endpoint, `tagsMerge(source, destination)` to merge multiple
tags into a single one. The "sources" must be provided as a list of ids
and the destination as a single id. All usages of the source tags
(scenes, markers (primary and additional), images, galleries and
performers) will be updated to the destination tag, all aliases of the
source tags will be updated to the destination, and the name of the
source will be added as alias to the destination as well.

* Add merge tag UI
* Add unit tests
* Update test mocks
* Update internationalisation
* Add changelog entry

Co-authored-by: gitgiggety <gitgiggety@outlook.com>
2021-06-16 14:33:54 +10:00
WithoutPants
c70faa2a53
Tag aliases (#1412)
* Add Tag Update/UpdateFull
* Tag alias implementation
* Refactor tag page
* Add aliases in UI
* Include tag aliases in q filter
* Include aliases in tag select
* Add aliases to auto-tagger
* Use aliases in scraper
* Add tag aliases for filename parser
2021-05-26 14:36:05 +10:00
EnameEtavir
9aa2dfd96c
fix typos in performer models repo interface (#1410)
tag methods used sceneID argument name instead of performerID
2021-05-24 14:07:08 +10:00
UnluckyChemical765
547f6d79ad
Add Handy / Funscript support (#1377)
* Add funscript route to scenes

Adds a /scene/:id/funscript route which serves a funscript file, if present.

Current convention is that these are files stored with the same path, but with the extension ".funscript".

* Look for funscript during scan

This is stored in the Scene record and used to drive UI changes for funscript support.

Currently, that's limited to a funscript link in the Scene's file info.

* Add filtering and sorting for interactive
* Add Handy connection key to interface config
* Add Handy client and placeholder component.

Uses defucilis/thehandy, but not thehandy-react as I had difficulty integrating the context with the existing components.

Instead, the expensive calculation for the server time offset is put in localStorage for reuse.

A debounce was added when scrubbing the video, as otherwise it spammed the Handy API with updates to the current offset.
2021-05-24 13:34:28 +10:00
InfiniteTF
896c3874af
Stash-Box Performer Tagger (#1277)
* Add bulk stash-box performer task
* Add stash-box performer scraper to scrape with menu
2021-05-03 14:21:20 +10:00
WithoutPants
a3609079bb
Autotag support for images and galleries (#1345)
* Add compound queries for images and galleries
* Implement image and gallery auto tagging
2021-05-03 13:09:46 +10:00
julien0221
70b66d91a0
Added rating to performers and studios (#1308) 2021-04-26 13:48:32 +10:00
WithoutPants
2eb2d865dc
Auto tag rewrite (#1324) 2021-04-26 12:51:31 +10:00
WithoutPants
8705f78591
Duplicate checker UI improvements (#1309)
* Add tools settings page
* Add tools and move dupe checker
* Make negative number get all
* Show missing phashes
* Add multi-edit button
* Show scene details
2021-04-20 18:58:28 +10:00
julien0221
d673c4ce03
added details, deathdate, hair color, weight to performers and added details to studios (#1274)
* added details to performers and studios
* added deathdate, hair_color and weight to performers
* Simplify performer/studio create mutations
* Add changelog and recategorised

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-04-16 16:06:35 +10:00
WithoutPants
ea54a67798
Add scene/image/gallery popover count buttons for performer/studio/tag cards (#1293)
* Add counts to graphql schema
* Add count resolvers and query refactor
* Add count popover buttons
2021-04-15 10:46:31 +10:00
InfiniteTF
c38660d209
Add phash generation and dupe checking (#1158) 2021-04-12 09:04:40 +10:00
InfiniteTF
58243cded0
Remove slim graphql endpoints (#1207) 2021-03-17 11:17:01 +11:00
WithoutPants
b3966b3c76
Remove streaming resolutions over max configured (#1187) 2021-03-11 12:51:42 +11:00
WithoutPants
a0676d5c30
Performer tags (#1132)
* Add scraping support for performer tags
* Add performer count to tag cards
* Refactor sqlite test setup
* Add performer tag filtering in gallery and image
* Add bulk update performer
* Add Performers tab to tag page
* Add count filters and sort bys for tags
* Move scene count to icon in performer card #1148
2021-03-10 12:25:51 +11:00
WithoutPants
1850a2b533
Add sqlite filter builder. Add AND, OR, NOT filters to scene filter (#1115)
* Add resolution enum extension
* Add filter builder
* Use filterBuilder for scene query
* Optimise joins
* Add binary operators to scene query
* Use Query for auto-tag
2021-03-02 11:27:36 +11:00
WithoutPants
e4d91a0226
String regex filter criteria and selective autotag (#1082)
* Add regex string filter criterion
* Use query interface for auto tagging
* Use Query interface for filename parser
* Remove query regex interfaces
* Add selective auto tag
* Use page size 0 as no limit
2021-02-02 07:57:56 +11:00
InfiniteTF
4fd022a93b
Decouple galleries from scenes (#1057) 2021-02-02 07:56:54 +11:00
InfiniteTF
89fcd6d775
Make file upload limits configurable (#1079) 2021-01-29 20:27:02 +11:00
WithoutPants
3b41894dbd
Add backup database functionality (#1069) 2021-01-21 22:02:09 +11:00
WithoutPants
1e04deb3d4
Data layer restructuring (#997)
* Move query builders to sqlite package
* Add transaction system
* Wrap model resolvers in transaction
* Add error return value for StringSliceToIntSlice
* Update/refactor mutation resolvers
* Convert query builders
* Remove unused join types
* Add stash id unit tests
* Use WAL journal mode
2021-01-18 12:23:20 +11:00
SpedNSFW
03a9d65cfe
extend resolutions (#1036)
* extend resolutions
 - Simplifies logic
 - Adds more options including 540p, 1440p, and resolutions common to VR such as 1920p
 - Supports vertical/portrait videos and images
* implement new resolution filters
2021-01-07 16:10:59 +11:00
InfiniteTF
e84c92355e
Fix integer overflow for scene size on 32bit systems (#994)
* Fix integer overflow for scene size on 32bit systems
* Cast to double in sqlite to prevent potential overflow
* Add migration to reset scene sizes and scan logic to repopulate if empty
2020-12-22 10:29:53 +11:00
WithoutPants
aadbcaeec2
Organised flag (#988)
* Add organized boolean to scene model (#729)
* Add organized button to scene page
* Add flag to galleries and images
* Import/export changes
* Make organized flag not null
* Ignore organized scenes for autotag

Co-authored-by: com1234 <com1234@notarealemail.com>
2020-12-18 08:06:49 +11:00
InfiniteTF
99bd7bc750
Fix broken isMissing filters (#1000) 2020-12-17 20:27:44 +01:00
WithoutPants
86747acc78
Use changesets correctly when updating objects (#976) 2020-12-04 12:42:56 +11:00
InfiniteTF
a7d333786f
Fix studio parent getting wiped in edit mode (#973) 2020-11-30 10:50:04 +11:00
WithoutPants
54c9f167ba
Show studio as text in scene cards where studio image isn't set (#965) 2020-11-27 08:01:56 +11:00
JoeSmithStarkers
df37ddcc2c
Added natural sort for scene and image titles (#943)
* Added natural sort for scene and images
* Use natural sort for movie names

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-11-25 20:09:07 +11:00
WithoutPants
5f482b7b8a
Handle zip file modification (#877)
* Rescan zip if updating mod time
* Use inequality for mod time comparison
* Add sort by file_mod_time (fixes #469)
2020-11-05 10:26:51 +11:00
InfiniteTF
9ec762ae9a
Fix outstanding tagger issues (#912)
* Fix potential image errors
* Fix issue preventing favoriting of tagged performers
* Add error handling in case of network issues
* Show individual search errors
* Unset scene results if query fails
* Don't abort scene submission if scene id isn't found
2020-11-05 08:28:58 +11:00
WithoutPants
bae82513eb
Add equals/not equals string criteria (#917)
* Fix encoding of string criteria
* Add equals and includes (and not) string criteria
2020-11-03 09:26:07 +11:00
WithoutPants
8e75a8fff5
Add selection and export for all list pages (#873)
* Include studios in movie export
* Generalise cards
* Add selection and export for movies
* Refactor gallery card
* Refactor export dialogs
* Add performer selection and export
* Add selection and export for studios
* Add selection and export of tags
* Include movie scenes and gallery images
2020-10-31 09:41:12 +11:00
WithoutPants
90c5a9dd4a
Add page sizes up to 1000 (#904) 2020-10-29 09:27:56 +11:00
InfiniteTF
3346f8dcca
Stash-box tagger integration (#454) 2020-10-24 14:31:39 +11:00
SpedNSFW
147d0067f5
Add gallery scraping (#862) 2020-10-21 09:24:32 +11:00
WithoutPants
8eda72ad89
Image improvements (#847)
* Fix image performer filtering
* Add performer images tab
* Add studio images tab
* Rename interface
* Add tag images tab
* Add path filtering for images
* Show image stats on stats page
* Fix incorrect scan counts after timeout
* Add gallery filters
* Relax scene gallery selector
2020-10-20 10:11:15 +11:00
InfiniteTF
d9270dd7c3
Treat empty string columns as missing (#852) 2020-10-16 11:14:48 +11:00
InfiniteTF
528b32d1b7
Sort images in galleries by path (#855) 2020-10-16 10:56:24 +11:00
InfiniteTF
73eb5c7a1f
Add image-count sorting, and image deletion on gallery deletion (#853) 2020-10-16 10:35:50 +11:00
WithoutPants
aca2c7c5f4
Images section (#813)
* Add new configuration options
* Refactor scan/clean
* Schema changes
* Add details to galleries
* Remove redundant code
* Refine thumbnail generation
* Gallery overhaul
* Don't allow modifying zip gallery images
* Show gallery card overlays
* Hide zoom slider when not in grid mode
2020-10-13 10:12:46 +11:00
WithoutPants
ade109d9e4
Path filter for scenes and galleries (#834) 2020-10-12 08:19:51 +11:00
WithoutPants
98dda782aa
Prevent invalid date tag in video file from aborting scan (#836)
* Give more context when ffprobe fails
* Suppress JSONTime unmarshal error
* Tidy scan logging
2020-10-11 12:02:41 +11:00
WithoutPants
8866670e53
Add partial import functionality (#812) 2020-09-20 18:36:02 +10:00
WithoutPants
7a45943e8e
Stash box client interface (#751)
* Add gql client generation files
* Update dependencies
* Add stash-box client generation to the makefile
* Move scraped scene object matchers to models
* Add stash-box to scrape with dropdown
* Add scrape scene from fingerprint in UI
2020-09-17 19:57:18 +10:00
WithoutPants
03d4826c85
Selective export (#770) 2020-09-15 17:28:53 +10:00
caustico
5df1e0025f
Add filter on Movie section "Is Missing is scenes" (#800) 2020-09-14 10:35:54 +10:00
WithoutPants
16ea6abf91
Fix age filtering regression (#778)
* Show filter control in loading/error
* Add performer age unit tests
* Fix addWhere regression
2020-08-31 18:17:17 +10:00
WithoutPants
1fd3fcc6a8
Show and allow creation of unknown performers/tags/studios/movies from scraper dialog (#741)
* Fix toast container z-index
* Make scrape operations network only
* Add CollapseButton component
2020-08-22 18:12:39 +10:00
WithoutPants
e16118f551
Clear image (#722)
* Allow clearing of tag images
* Allow clearing of studio images
* Allow clearing of performer images
* Allow clearing of movie images
* Add filtering for missing images
2020-08-12 09:19:27 +10:00
woodgen
4045ddf3e9
Implement scraping movies by URL (#709)
* api/urlbuilders/movie: Auto format.

* graphql+pkg+ui: Implement scraping movies by URL.

This patch implements the missing required boilerplate for scraping
movies by URL, using performers and scenes as a reference.

Although this patch contains a big chunck of ground work for enabling
scraping movies by fragment, the feature would require additional
changes to be completely implemented and was not tested.

* graphql+pkg+ui: Scrape movie studio.

Extends and corrects the movie model for the ability to store and
dereference studio IDs with received studio string from the scraper.
This was done with Scenes as a reference. For simplicity the duplication
of having `ScrapedMovieStudio` and `ScrapedSceneStudio` was kept, which
should probably be refactored to be the same type in the model in the
future.

* ui/movies: Add movie scrape dialog.

Adds possibility to update existing movie entries with the URL scraper.

For this the MovieScrapeDialog.tsx was implemented with Performers and
Scenes as a reference. In addition DurationUtils needs to be called one
time for converting seconds from the model to the string that is
displayed in the component. This seemed the least intrusive to me as it
kept a ScrapeResult<string> type compatible with ScrapedInputGroupRow.
2020-08-10 15:34:15 +10:00
WithoutPants
5992ff8706
Add oshash support (#667) 2020-08-06 11:21:14 +10:00
WithoutPants
c104c6d075
Generate content for specific scenes (#672)
* Add UI dialog for scene(s)
* Move preview preset to config
2020-07-19 11:59:18 +10:00
WithoutPants
e9141b5dfc
Fix tag query performance problems (#657)
* Fix sql tracing
* Disable query by marker count
* Disable unit test
2020-07-09 08:42:07 +10:00
WithoutPants
244ae54f3f
Add grid view, image to tag (#641)
* Add grid view for tags
* Add tag page
* Import/export tags
* Add tag name uniqueness checks
* Fix styling on missing marker previews
* Add trace loglevel
* Add SQL trace
* Add filter options for tags
* Add tag sort by options
* Add tag page keyboard shortcuts
2020-07-07 10:35:43 +10:00
WithoutPants
7a74658a73
Move image blobs into separate tables (#618)
* Scene cover fallback to database
* Fix panic if studio not found
* Fix movie studio not being imported/exported
2020-06-23 09:19:19 +10:00
WithoutPants
d3ababf0a1
Gallery list improvement (#622)
* Add grid view to galleries
* Show scene in gallery card
* Add is missing scene gallery filter
* Don't store galleries with no images
2020-06-21 21:43:57 +10:00
WithoutPants
96e6e16507
Parent studios (#595)
* Refactor getMultiCriterionClause
Co-authored-by: Anon247 <61889302+Anon247@users.noreply.github.com>
2020-06-15 21:34:39 +10:00
bnkai
dc5efb9e31
Unit testing for performers,studios,movies FindByName/s (#581) 2020-05-27 10:48:45 +10:00
bnkai
ccd75731b7
Change scrape matching (studio, movies, tag, performers) to case insensitive (#556)
* Change scrape matching (studio, movies, tag, performers) to case insensitive
* * fix collate order
* * make filename parser findbyname calls case insensitive
* * add unit testing for Tags GetFindbyName/s
2020-05-24 16:19:22 +10:00
InfiniteTF
32fce9ac6f
Speed up tag count queries (#570)
* Speed up tag count queries
* Add test for marker CountByTagID

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-05-24 16:18:02 +10:00
bnkai
d74a303c00
Fix 0 undefined library size on empty db (#535) 2020-05-14 10:44:13 +10:00
bnkai
bd45daacf3
Add a cache for gallery thumbnails (#496) 2020-05-11 17:20:08 +10:00
InfiniteTF
8ba76783b0
Query optimizations (#478)
* Remove slow and largely pointless groupbys
* Change scene.query to use querybuilder
2020-05-11 15:19:11 +10:00
InfiniteTF
e9c68897d7
Add is-missing tags filter (#526) 2020-05-09 12:21:08 +10:00
WithoutPants
99f88b8d73
Querybuilder integration tests (#513)
* Vet fixes
* Change low resolution to < 480
2020-05-04 17:02:49 +10:00
WithoutPants
3d22d5a742
Refactor build (#493)
* Add lint/format checks to build
* Make travis get full repo to get tags
* Run packr2 once in cross-compile
* Fix quotes in package.json
* Fix linting issues
* Formatting
* Fix vet issue
* Fix go lint issues
* Show start of each platform compilation
* Add validate target
* Set gitattributes for go fmt and mod vendor
* Fix tag name
* Add fmt-ui target
2020-04-29 12:13:08 +10:00
bnkai
52a1059380
Make image extension check in zip files case insensitive (#501) 2020-04-29 09:24:01 +10:00
WithoutPants
5923917e6c
Clean missing galleries (#489)
* Clean missing galleries
* Refactor matchFile
2020-04-25 09:32:55 +10:00
bnkai
29336d1ee0
Move image with cover.jpg in name to first place in Galleries (#477) 2020-04-24 12:53:18 +10:00
bnkai
9b1518beae
Export performance optimization (#475)
* recreate metadata path if needed, before exporting data
2020-04-24 12:52:21 +10:00
WithoutPants
ba09bfa64a
Include scene o-counter in import/export (#488)
* Include o-counter in import/export
* Fix scene card o-counter display
2020-04-23 09:14:58 +10:00
WithoutPants
eee7adfb85
Add Studio to movie and fix movie schema (#458)
* Add movie migration
* Update server and UI code for type changes
* Add studio to movies
* Movie blobs to end
* Document movie duration
* Add filtering on movie studio
2020-04-22 11:22:14 +10:00
InfiniteTF
2a3c9742cc
Add slim endpoints for entities to speed up filters (#460)
* Move performers image column to end of table
* Remove redundant index
2020-04-19 12:03:51 +10:00
WithoutPants
849a5261a3
Include gender in performer scraper results (#448)
* Fix scraper gender
* Set scraped gender in the UI
* Match gender on enum or case insensitive string
2020-04-11 13:26:53 +10:00
bnkai
d5617307f1
Add detection of container/video_codec/audio_codec compatibility for live file streaming or transcoding (#384)
* add forceMKV, forceHEVC config options
* drop audio stream instead of trying to transcode for ffmpeg unsupported/unknown audio codecs
2020-04-10 08:38:34 +10:00
Anon247
dc37a3045b
Added various missing filters to performer page (#438) 2020-04-08 14:21:05 +10:00
bnkai
8a6fff61ae
Enable sorting for galleries (#437) 2020-04-03 14:40:37 +11:00
bnkai
e58c311ddd
Add library size to main stats page (#427) 2020-04-03 13:44:17 +11:00
Anon247
0bbb2bd1d0
Fix to allow scene to be removed when attached to a movie (#421) 2020-04-01 12:07:43 +11:00
hiddenpants255
494b794228
Add gender support for performer (#371)
Co-authored-by: HiddenPants255 <>
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-04-01 09:36:38 +11:00
WithoutPants
34d829338d
Add image scraping support (#370)
* Add sub-scraper functionality
* Add scraping of performer image
* Add scene cover image scraping
* Port UI changes to v2.5
* Fix v2.5 dialog suggest color
* Don't convert eol of UI to support pretty
2020-03-11 11:41:55 +11:00
caustico
5fb8bbf768
Movies Section (#338)
Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-03-10 14:28:15 +11:00
InfiniteTF
41f7a46ac1
Fix performer height filter error (#388)
* Fix performer height filter error
* Make all performer columns qualified

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2020-03-03 10:30:29 +11:00
InfiniteTF
80a8d2de97
Use parameter binding for all queries (#387) 2020-03-03 09:18:14 +11:00
WithoutPants
f87117b0d6
Add O-counter (#334)
* Add backend support for o-counter

* Add o-counter buttons everywhere

* Put o-counter button right-aligned on tabs

* Add o-counter filter
2020-02-02 19:17:28 -05:00
InfiniteTF
6a6e8d8875
Change thumbnail default size and resize algorithm (#336)
* Change thumbnail resize algorithm and add size parameter

* Height -> Width

* Change default size from 100px to 200px

* Height -> width
2020-01-31 17:19:15 -05:00
WithoutPants
3d3f8877de Accept random seed from UI for random sorting (#328) 2020-01-24 22:35:21 -05:00
WithoutPants
cf96cae4c8 Add scene duration filter (#313)
* Add scene duration filter
2020-01-13 11:43:14 -05:00
Stash Dev
f8aa0433a3 Fix scene covers not importing correctly 2020-01-06 15:18:06 -08:00
WithoutPants
488cd5575d Use arg for regex queries (#311) 2020-01-06 13:02:25 -05:00
Stash Dev
653406efd1 Added support for import / export of scene cover images 2019-12-31 14:38:49 -08:00
WithoutPants
f52db4f58b Add stash scraper type (#269)
* Add stash scraper type

* Add graphql client to vendor

* Embed stash credentials in URL

* Fill URL from scraped scene

* Nil IDs returned from remote stash

* Nil check
2019-12-20 19:13:23 -05:00
WithoutPants
1704d3771f Add scene auto-tagging from filename (#204)
* Add auto tagging for performers, studios and tags

* Fix scene title logging

* Fix golang 1.11 compile error

* Improve regex pattern. Only log when added

* Remove paging from parse query

* Add integration test

* Fix prefix detection on paths
2019-12-01 11:18:44 -05:00
bnkai
a6b8a3f2e8 Make sort filter queries for name case insensitive (#183) 2019-11-15 17:12:47 -05:00
WithoutPants
84bee2eb60 Performers, Tags and Studio from scene filename (#174)
* Make regex matching case-insensitive

* Port filename parser code to backend

* Add performers to scene filename parser UI

* Finish porting parser to backend

* Add performer, studio and tag parsing

* Hide fields not being parsed

* Don't query for empty performer/studio/tag

* Use exact matches

* Fix panic

* Fix arrays changed false positive. Fix layout
2019-11-07 07:49:08 -05:00
WithoutPants
3c089dd97c More performer filter criteria (#179)
* Add new performer filter criteria to UI

* Add backend support for new performer criteria
2019-11-06 23:36:48 -05:00
WithoutPants
7cb9cd8a38 Scene filename to metadata parser (#164)
* Initial UI prototype

* Add backend support to update multiple scenes

* Fix title editing issues

* Add query regex support. UI improvements

* Rewrite parser. Add fields button and page size

* Add helper text for escaping {} characters

* Validate date

* Only set values if different from original

* Only update scenes that have something changed

* Add built in parser input recipes

* Make pattern matching case-insensistive
2019-10-30 09:37:21 -04:00
WithoutPants
d0730c7243 Add query options for tags, performers, studios #29 (#157)
* Add query options for tags, performers, studios

* Remove errant log

* Apply expanded query criteria to scene markers
2019-10-27 09:05:54 -04:00
Leopere
d7271d75fc
Merge pull request #109 from WithoutPants/optional_performer_image
Generate performer checksum from name instead of image. Use default performer image
2019-10-24 15:35:26 -04:00
WithoutPants
71a4cc6a07 Merge from master 2019-10-24 15:07:34 +11:00
Leopere
ccde317a56
Merge pull request #146 from endqwerty/add_clean_func
Add functionality to the Clean Button
2019-10-18 02:35:25 -04:00
Leopere
0d439ef42b
Merge pull request #97 from WithoutPants/delete_tag
Add delete tag button #96
2019-10-18 02:34:56 -04:00
WithoutPants
1ac6703d7f Merge from master 2019-10-18 08:15:45 +11:00
daposy
de1a2a9007 use WithoutPants logic for cleaning up artifacts 2019-10-16 18:13:42 -07:00
WithoutPants
9d41963d05 Display error when deleting tag used as primary 2019-10-17 11:56:08 +11:00
daposy
6aa54c2775 add functionality to clean button 2019-10-16 16:47:53 -07:00
WithoutPants
1b98702e17 Merge from master 2019-10-17 09:31:04 +11:00
Leopere
c8e0ac7d20
Merge pull request #132 from friendlycrab/cleanup
Remove unused and generated code
2019-10-16 16:59:18 -04:00
Friendly C
e6bcff0767 Remove generated GraphQL files 2019-10-15 17:04:02 +02:00
Leopere
57e954d4e7
Merge pull request #137 from WithoutPants/nullable_scene_props
Allow unsetting of rating, studio, gallery
2019-10-15 10:09:26 -04:00
WithoutPants
a4f0a80816 Fix error when updating objects with slice data 2019-10-15 12:17:56 +11:00
WithoutPants
4433917768 Return updated scene after update 2019-10-15 10:54:05 +11:00
WithoutPants
0852199e27 Only update non-nil database fields 2019-10-15 08:57:53 +11:00
WithoutPants
470c64b840 Allow unsetting of rating, studio, gallery 2019-10-12 22:32:01 +11:00
WithoutPants
afcadd941b Make title from file metadata optional 2019-10-12 19:20:27 +11:00
bill
ac2bc77407 fix isMissing date filter 2019-09-16 00:52:02 +03:00
WithoutPants
41c8cac738
Merge branch 'master' into optional_performer_image 2019-08-27 19:21:25 +10:00
WithoutPants
57073faab7
Merge branch 'master' into delete_scene 2019-08-25 17:41:32 +10:00
WithoutPants
9c92e64106 Use random performer image if none provided 2019-08-24 17:17:25 +10:00
WithoutPants
7562792589 Add custom css 2019-08-23 08:24:14 +10:00
WithoutPants
20662532d8 Studio checksum from name. Default image 2019-08-21 15:48:36 +10:00
WithoutPants
043d073bcf Use png for default performer image 2019-08-21 13:14:40 +10:00
WithoutPants
996fd9c70a Performer checksum from name. Default image 2019-08-21 12:51:30 +10:00
WithoutPants
c3e4c5702a
Merge branch 'master' into delete_scene 2019-08-20 15:37:58 +10:00
StashAppDev
da71a59493
Merge pull request #101 from WithoutPants/issues/69
Show studios with no scenes #69
2019-08-19 16:23:30 -07:00
WithoutPants
7ee1b3f052 Add options to delete file and generated files 2019-08-16 07:21:35 +10:00
WithoutPants
cfe2636837 Add delete scene button 2019-08-15 17:32:57 +10:00
WithoutPants
ec9020c1b9 Use left join for studios #69 2019-08-15 11:30:32 +10:00
WithoutPants
35bcf97a7a Add delete for performers and studios 2019-08-15 07:40:51 +10:00
WithoutPants
45f72a549f Delete scene/marker tag refs when deleting tags 2019-08-13 09:03:16 +10:00
Stash Dev
4f016ab3c9 Random sort now paginates without duplicates 2019-07-27 13:22:38 -07:00
bill
92d90863a8 fix bug:Studios sort by scene_count reported by malcuk on discord 2019-05-31 01:59:29 +03:00
Stash Dev
4b037e1040 Dependency updates 2019-05-27 12:34:26 -07:00
Stash Dev
ec453c7a14 Added marker / scene audio interface option 2019-04-20 14:48:54 -07:00
Stash Dev
d6eb2c2d8e Scenes with a marker missing a primary tag fails to load
Fixes #42
2019-04-20 10:32:01 -07:00
Stash Dev
29a40c5bdd Configuration
* Added flags to customize the host and port
* Start up just one server rather than a server for HTTP and HTTPS.  HTTPS server will only start if a cert and key are found
2019-04-11 10:55:58 -07:00
Stash Dev
763424bc40 Update GQLGen and break up the schema.graphql file 2019-03-27 12:47:43 -07:00
Stash Dev
3b83371f84 Fix invalid scene marker tag count 2019-03-24 19:07:08 -07:00
Stash Dev
b1db98bd1f Filter improvement exploration
Changed the rating filter to allow for more than just an equality check.  This progresses #29.
2019-03-24 15:11:58 -07:00
Stash Dev
c1f1a6ccff More configuration options
* Allow configuration of generated file path and database path.  Closes #33
* Added checkboxes to choose what gets generated for the generate task.  Closes #32
2019-03-24 10:04:31 -07:00
Stash Dev
c73f78bb42 JPEG is a valid gallery file. Closes #28 2019-03-23 16:30:10 -07:00
Stash Dev
543d2597ec Tweaks
* Fixed scene marker "scene_updated_at" sort option
* Added "created_at" and "updated_at" sort options.  Closes #19
2019-03-23 16:27:53 -07:00
Stash Dev
ae9bbf237f Support multiple content folders. Closes #2 2019-03-23 14:09:05 -07:00
Stash Dev
dd22d88d07 Config Tweaks
Using viper for config management.  Added configuration endpoint.
2019-03-23 10:06:37 -07:00
Stash Dev
66d2c5ca04 UI V2
Squashed commits:
[e74bbf9] stuff
[28476de] stuff
[c7efb7b] stuff
[2c78f94] stuff
[f79338e] stuff
[a697876] stuff
[85bb60e] stuff
[9f108b2] stuff
[d8e00c0] stuff
[7787ef9] stuff
[f7f10b7] stuff
[aa266f7] stuff
[511ba6b] stuff
[7453747] stuff
[db55e2d] stuff
[b362623] stuff
[7288c17] stuff
[86638cd] stuff
[879dac4] stuff
[65a4996] stuff
[c6fb361] stuff
[d449ce7] stuff
[349dffa] stuff
[84206ab] stuff
[0253c65] stuff
[cc0992e] stuff
[3289e7d] stuff
[d9ab290] stuff
[dcc980d] stuff
[7787da8] stuff
[5bcf7cd] stuff
[00e9316] stuff
[54c9398] stuff
[72b6ee1] stuff
[4b4b26c] stuff
[4cbdb06] stuff
[1a240b3] stuff
[650ea08] stuff
[37440ef] stuff
[9ee66ba] stuff
[b430c86] stuff
[37159c3] stuff
[deba837] stuff
[6ac65f6] stuff
[a2ca1a1] stuff
[c010229] stuff
[3fd7306] stuff
[cbe6efc] stuff
[997a8d0] stuff
[d0708a2] stuff
[d316aba] stuff
[4fe9900] Added initial files
2019-03-15 15:33:51 -07:00
Stash Dev
c4d45db30c Fix json time when unmarshalling
https://github.com/stashapp/stash/issues/25
2019-03-09 10:14:55 -08:00
Stash Dev
f57c2bff1d Another date fix 2019-03-07 12:19:19 -08:00
Stash Dev
8d23357a13 Fix dates 2019-03-04 19:37:22 -08:00
Stash Dev
b70d5f33d2 Improved date handling 2019-03-04 17:14:52 -08:00
Stash Dev
b488c1ed7d Reorg 2019-02-14 15:42:52 -08:00