Commit Graph

1072 Commits

Author SHA1 Message Date
bnkai af6232ec97
Fix Query for Scene Markers (#1743) 2021-09-20 09:52:19 +10:00
liquid-flow 919249f851
Fix Scene Player CLS issue (#1739) 2021-09-19 11:31:52 +10:00
liquid-flow 13fda2ad85
Fix scene edit panel layout (#1737)
* Fix scene edit panel layout
2021-09-19 11:07:23 +10:00
gitgiggety 82e4ad4130
Execute Gallery.Create.Post plugin hook during scan (#1731)
* Execute Gallery.Create.Post plugin hook during scan

Fix issue where Gallery.Create.Post hook is not executed when a new
gallery is created during scan, when the gallery is created based on the
folder.

* Fix Gallery.Create.Post hook being invoked in transaction

Invoke the Gallery.Create.Post hook during zip scan after the
transaction has been committed. This is necessary to allow the plugin to
access the gallery (using GraphQL API). Otherwise the API obviously uses
a different database transaction which can't find the gallery as it
isn't committed yet.
2021-09-19 10:28:34 +10:00
gitgiggety b83ce29ac4
Scraper log improvements (#1741)
* Fix logs from scraper and plugins not being shown in UI

Using `logger.` in the logger package to write logs is "incorrect". This
as the package contains a variable named `logger` which contains the
logrus instance. So instead of the log line being handled by the custom
log implementation / wrapper which makes sure the lines are shown in the
UI as well, it's written to logrus directly meaning the wrapper is
skipped.

This "issue" is obviously triggered because in any other place
`logger.X` can be used and it will used the custom logger package /
wrapper which works fine.

* Add plugin / scraper name to logging output

Indicate which plugin / scraper wrote a log message by including its
name to the `[Scrape]` prefix.

* Add missing addLogItem call
2021-09-19 10:06:34 +10:00
WithoutPants 66f92c5dcc
Fix autotag tag alias (#1713)
* Add unit tests for tag alias
* Fix tag alias autotag
* Don't autotag non-path galleries
* Add studio alias tests
2021-09-17 09:23:56 +10:00
stg-annon d29699fa30
Support scraper logging to specific log levels (#1648)
* init scrapper log levels
* Refactor plugin logging

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-09-17 09:09:44 +10:00
WithoutPants 501ed7c2c2
Make hierarchical criterion depth input optional (#1733) 2021-09-16 20:41:07 +10:00
MartinWe13 e0c910d9e8
Adjustments German translation (#1730)
* Update de-DE.json

A few (first) adjustments to the German translation. Partly the words are chosen too long and translated not very technically.
2021-09-16 12:10:08 +10:00
gitgiggety f3119a6c38
Add AND, OR and NOT support to studio filter (#1726) 2021-09-16 12:09:23 +10:00
Still Hsu 23f852cd91
Add new zh-tw localizations & move non-legacy localization keys (#1693)
* Add new localizations & move non-legacy localization keys

Signed-off-by: Still Hsu <dev@stillu.cc>

* Fix sv-SE localization keys

Signed-off-by: Still Hsu <dev@stillu.cc>

* Fix duplicated key
* Add missing internationalisation

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-09-16 09:04:50 +10:00
gitgiggety 2274db16b7
Generate screenshot images for markers (#1604)
* Generate screenshot images for markers

In some scenarios it might not be possible to use the preview video or
image of markers, i.e. when only static images are supported like in
Kodi. So generate a static screenshot as well.

* Make generating animated and static image optional for markers
* Use screenshot for markers when preview type is set to static image
2021-09-15 12:27:05 +10:00
liquid-flow f5e4e7742e
[Bug Fix] Disable float-on-scroll JWPlayer feature on mobile (#1721)
* Disable video float on mobile
2021-09-15 10:13:45 +10:00
Perdition 3be23999ef
Update sv-SE.json (#1722)
Fixes a bunch of awkward sounding terms and other errors.
2021-09-14 23:21:59 +10:00
liquid-flow 612ecb72fc
[Bug Fix] Fix scene markers editor mobile UI (#1718)
* Fix mobile layout
2021-09-14 20:07:53 +10:00
gitgiggety b78060d361
Add rating sorting to galleries (#1720)
* Add rating sorting to galleries

Fixes: #1717
2021-09-14 18:11:12 +10:00
WithoutPants 1a3a2f1f83
Scrape scene by name (#1712)
* Support scrape scene by name in configs
* Initial scene querying
* Add to manual
2021-09-14 14:54:53 +10:00
gitgiggety 565064b441
Make IHierarchicalLabeledIdCriterion backwards compatible (#1716)
Add some form of backwards compatibility in the UI for
`IHierarchicalLabeledIdCriterion`. With this backwards compatibility
it's possible to recall saved filters which use the tags filter.
Otherwise stuff would blow up because the saved filter has a different
structure than what the `IHierarchicalLabeledIdCriterion` expects.
2021-09-11 10:01:57 +10:00
WithoutPants 13a289a4a8
Fix studio scene count sort (#1714) 2021-09-09 19:44:02 +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
SmallCoccinelle 82a41e17c7
Avoid wrapping strings.Replace in Contains (#1710)
The strings.Replace function counts the number of replacements. If 0,
the original string is returned. Hence, there is no need to check if a
replacement will happen before doing the work.
2021-09-09 14:10:39 +10:00
SmallCoccinelle 4b00d24248
Remove unused (#1709)
* Remove stuff which isn't being used

Some fields, functions and structs aren't in use by the project. Remove
them for janitorial reasons.

* Remove more unused code

All of these functions are currently not in use. Clean up the code by
removal, since the version control has the code if need be.

* Remove unused functions

There's a large set of unused functions and variables in the code base.
Remove these, so it clearer what code to support going forward.

Dead code has been eliminated.

Where applicable, comment const-sections in tests, so reserved
identifiers are still known.

* Fix use-def of tsURL

The first def of tsURL doesn't matter because there's no use before
we hit the 2nd def.

* Remove dead code assignment

Setting logFile = "" is effectively dead code, because there's no use
of it later.

* Comment out found

The variable 'found' is dead in the function (because no post-process
action is following it). Comment it for now.

* Comment dead code in tests

These might provide hints as to what isn't covered at the moment.

* Dead code removal

In the case of constants where iota is involved, move the iota so it
matches the current key values.

This avoids problems with persistently stored key IDs.
2021-09-09 14:10:08 +10:00
kermieisinthehouse 265d5f4c70
Apple Silicon Support, Bump Go to 1.17, refactor docker/build/x86_64/Dockerfile (#1646)
* Bump Go to 1.17, refactor build/x86_64 Dockerfile to make better use of multi-stage
* Bump to 1.17 from 1.16
* Bump packr version, provide needed legacy env var
* Add apple silicon support, fix macos build chain
* Update unused travis ci
2021-09-08 15:30:15 +10:00
SmallCoccinelle 4545da9af0
Avoid redundant break statements (#1705)
In Go, a switch-case automatically breaks on end. This makes
the break statement redundant.
2021-09-08 11:23:21 +10:00
SmallCoccinelle e7f6cb22b7
Error strings noncapitalized (#1704)
* Fix error string capitalization

Error strings often follow another string. Hence, they should not be
capitalized, unless referencing a name.

* Uncapitalize more error strings

While here, use %v on the error directly, which makes it easier to wrap
the error later with %w if need be.

* Uncapitalize more error strings

While here, rename Url to URL as a nitpick.
2021-09-08 11:23:10 +10:00
SmallCoccinelle d2a0a8fe4c
Correct error propagation (#1703)
Rename an inner error to imageErr. This avoids a shadowing of an error
in the following lines which aren't returned otherwise.
2021-09-08 11:22:56 +10:00
Alpaca Serious b482fbc796
Swedish Translation (#1691)
* Added Swedish translation
* Update SettingsInterfacePanel.tsx
* Update index.ts
* Update sv-SE.json
2021-09-08 11:08:07 +10:00
SmallCoccinelle a3f38d8edf
When stopping, close the database (#1686)
* When stopping, close the database

This patch is likely to cause errornous behavior in the application.
This is due to the fact that the application doesn't gracefully shut
down, but is forcefully terminated.

However, the purpose is to uncover what needs to be done, to make
it a more graceful shutdown.
2021-09-07 14:28:40 +10:00
fnoopv 651d2e6373
Add missing translation (#1701) 2021-09-07 13:30:59 +10:00
SmallCoccinelle b76283df08
Fix data race in progress_test (#1696)
The call to p.ExecuteTask happens in a separate go-routine. It writes,
under m.mutex, into the job's details. However, the test goroutine
itself reads j.Details which is a read race.

Protect the reads in the test by the lock.

This makes `package job` pass `go test -race`
2021-09-07 13:30:26 +10:00
SmallCoccinelle 489db34db2
Remove assignments to _ (#1685)
It's a no-op if we are not using it, so it can be safely removed.
2021-09-07 13:18:32 +10:00
gitgiggety b2b05fb332
Add Movie option to Scene bulk edit (#1676)
* Add Movie option to Scene bulk edit
2021-09-07 12:44:18 +10:00
gitgiggety 7a468413da
Add movies tab to Studios and Performers page (#1675)
* Add movies tab to Studios page
* Add performers filter to movies
* Add movies tab to performers page
2021-09-07 12:16:33 +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
WithoutPants 04e146f290
Merge pull request #1700 from stashapp/master
Merge master to develop for version tag
2021-09-06 17:03:37 +10:00
WithoutPants ab10cf8251
Merge pull request #1697 from stashapp/develop
Merge develop to master for 0.9
2021-09-06 12:47:07 +10:00
Tweeticoats a73c99a61d
Update docker file to add mechanicalsoup python library (#1688)
Add a new python library mechanicalsoup to the docker container.
There is a pending pull request in the Community scrapers for the Ifeelmyself that uses this library so it might be worth including it in the container.
This should add ~100k to the size of the container.
2021-08-31 20:14:39 +10:00
WithoutPants 709d7ce1cc
Load TLS config files from config path before stash home (#1678)
* Load tls files from config or home directory
* Update README
* Require both ssl files if either present
2021-08-31 19:37:45 +10:00
gitgiggety 1774a3600c
Fix Performers Is Missing: stash ID filter (#1681)
* Fix Performers Is Missing: stash ID filter.

Fixes #1679
2021-08-30 11:46:41 +10:00
FleetingOrchard 50cb6a9c79
Add duration statistics to stats page (#1626) 2021-08-26 13:37:08 +10:00
UnluckyChemical765 45a9aabdaf
Add script offset / delay to Handy support. (#1573)
* Add script offset / delay to Handy support.

Further work on  #1376.

Offsets are added to the current video position, so a positive value leads to earlier motion.  (The most common setting.)

This is needed because most script times have a consistent delay when compared to the video. (Delay from the API calls to the server should be handled by the server offset calculation.)

* Rename scriptOffset to funscriptOffset
* Correct localisation keys

Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
2021-08-26 11:50:02 +10:00
gitgiggety 50217f6318
Rebuild image edit using formik (#1669)
* Rebuild image edit using formik
* Prompt on page leave when changes are not saved
* Only enables save when changes are made
* Wrap in <Form onSubmit> (not sure if this does anything)
2021-08-26 11:24:49 +10:00
gitgiggety 2e83405841
Add "toolbar" buttons for some list actions (#1673)
* Support adding buttons to list "toolbar"
* Show add and remove images to gallery in toolbar
* Show button to play selected scenes to list toolbar
2021-08-26 10:46:07 +10:00
gitgiggety e98302fcd0
Add image and gallery count to tag listing (#1672) 2021-08-26 10:18:13 +10:00
gitgiggety 3f888a0335
Fix error when creating scene queue of single item (#1674)
* Fix error when creating scene queue of single item
2021-08-26 10:03:56 +10:00
gitgiggety 4c144db510
Performers listing improvements (#1671)
* Add sorting on image and gallery count to performers
* Make performer table headers translatable
* Add image and gallery count to performers table
* Make sure list table container fits the table

Make the table container minimally as wide as the table. This fixes the
table "overflowing" to the left and right and the left not being
accessible.

* Remove unnecessary truncation in tables

IMO there is no need to truncate the title in the scenes table and the
name in the performers table. This because both tables also contain an
image which means that multiple lines should be possible without really
extending the height of the row. Furthermore both tables contain other
values which might be way longer and also aren't wrapped (like tags and
performers for scenes, and aliases for performers).
2021-08-26 09:41:18 +10:00
Still Hsu 177339c14e
Update zh-tw strings & fix various hard strings (#1666)
* Update unlocalized strings & fix various hard strings
* Fix incorrect placement of ignore_organized in en-US
* Add missing strings
* Fix hard string in PerformerList
2021-08-26 08:51:54 +10:00
EnameEtavir cb6dab3c5f
Fix: config race conditions with RWMutex (#1645)
* Fix: config race conditions with RWMutex

Added RWMutex to config.Instance which read or write locks
all instances where viper is used.

Refactored checksum manager to only use config and not
viper directly anymore.

All stash viper operations are now "behind" the config.Instance
and thus mutex "protected".
2021-08-24 15:18:30 +10:00
gitgiggety da8803925c
Add date, duration and rating to Movie sorting (#1663)
* Add date, duration and rating to Movie sorting

Fixes: #1637
2021-08-24 15:04:17 +10:00