Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ class StashApolloCompilerPlugin : ApolloCompilerPlugin {
"SavedFindFilterType",
)
) ||
file.name.endsWith("CriterionInput")
file.name.endsWith("CriterionInput") ||
file.name in
setOf(
"FingerprintFilterInput",
"VideoFileFilterInput",
"ImageFileFilterInput",
)
) {
// Modify filter or filter input types
handleFilterInput(file, stashFilterInterface)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/graphql/Configuration.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ query Configuration {
showStudioAsText
customLocalesEnabled
customLocales
sfwContentMode
}
ui
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/graphql/FindGroups.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fragment GroupData on Group {
}
scene_count
performer_count
o_counter
front_image_path
back_image_path
created_at @catch(to: NULL)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/graphql/FindStudios.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
fragment StudioData on Studio {
id
name
url

Check warning on line 35 in app/src/main/graphql/FindStudios.graphql

View workflow job for this annotation

GitHub Actions / build

Apollo: Use of deprecated field `url`

Check warning on line 35 in app/src/main/graphql/FindStudios.graphql

View workflow job for this annotation

GitHub Actions / build

Apollo: Use of deprecated field `url`
parent_studio {
id
name
url

Check warning on line 39 in app/src/main/graphql/FindStudios.graphql

View workflow job for this annotation

GitHub Actions / build

Apollo: Use of deprecated field `url`

Check warning on line 39 in app/src/main/graphql/FindStudios.graphql

View workflow job for this annotation

GitHub Actions / build

Apollo: Use of deprecated field `url`
image_path
__typename
}
Expand All @@ -62,6 +62,7 @@
# performer_count_all: performer_count(depth: -1)
group_count
# group_count_all: group_count(depth: -1)
o_counter
details
rating100
aliases
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ class SceneDetailsFragment : DetailsSupportFragment() {
StashCoroutineExceptionHandler(
Toast.makeText(
requireContext(),
getString(R.string.failed_o_counter),
getString(R.string.failed_update),
Toast.LENGTH_SHORT,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ sealed interface SortOption {
@Serializable
data object Path : SortOptionImpl("path", R.string.stashapp_path)

@Serializable
data object PerformerAge : SortOptionImpl("performer_age", R.string.stashapp_performer_age)

@Serializable
data object PenisLength : SortOptionImpl("penis_length", R.string.stashapp_penis_length)

Expand Down Expand Up @@ -153,6 +156,10 @@ sealed interface SortOption {
@Serializable
data object SceneCode : SortOptionImpl("code", R.string.stashapp_scene_code, Version.V0_28_0)

@Serializable
data object ScenesDuration :
SortOptionImpl("scenes_duration", R.string.stashapp_scenes_duration)

@Serializable
data object SceneId : SortOptionImpl("scene_id", R.string.stashapp_scene_id)

Expand All @@ -170,6 +177,9 @@ sealed interface SortOption {
@Serializable
data object Seconds : SortOptionImpl("seconds", R.string.stashapp_seconds)

@Serializable
data object Studio : SortOptionImpl("studio", R.string.stashapp_studio)

@Serializable
data object TagCount : SortOptionImpl("tag_count", R.string.stashapp_tag_count)

Expand Down Expand Up @@ -253,12 +263,14 @@ sealed interface SortOption {
Organized,
Path,
PerceptualSimilarity,
PerformerAge,
PerformerCount,
PlayCount,
PlayDuration,
Rating,
ResumeTime,
SceneCode,
Studio,
TagCount,
Title,
)
Expand Down Expand Up @@ -298,6 +310,7 @@ sealed interface SortOption {
Date,
Duration,
Name,
OCounter,
Rating,
ScenesCount,
)
Expand All @@ -317,6 +330,7 @@ sealed interface SortOption {
PlayCount,
Rating,
ScenesCount,
ScenesDuration,
TagCount,
CareerLength,
Measurements,
Expand All @@ -342,6 +356,7 @@ sealed interface SortOption {
Name,
Rating,
ScenesCount,
ScenesDuration,
TagCount,
)

Expand All @@ -354,6 +369,7 @@ sealed interface SortOption {
PerformersCount,
SceneMarkersCount,
ScenesCount,
ScenesDuration,
)

fun sortByName(dataType: DataType): SortOption =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private val SceneFilterOptions =
),
FilterOption<SceneFilterType, IntCriterionInput>(
"o_counter",
R.string.stashapp_o_counter,
R.string.stashapp_o_count,
null,
IntCriterionInput::class,
{ it.o_counter },
Expand Down Expand Up @@ -493,7 +493,7 @@ private val PerformerFilterOptions =
),
FilterOption<PerformerFilterType, IntCriterionInput>(
"o_counter",
R.string.stashapp_o_counter,
R.string.stashapp_o_count,
null,
IntCriterionInput::class,
{ it.o_counter },
Expand Down Expand Up @@ -663,7 +663,7 @@ private val ImageFilterOptions =
),
FilterOption<ImageFilterType, IntCriterionInput>(
"o_counter",
R.string.stashapp_o_counter,
R.string.stashapp_o_count,
null,
IntCriterionInput::class,
{ it.o_counter },
Expand Down Expand Up @@ -1217,6 +1217,15 @@ private val GroupFilterOptions =
{ filter, value -> filter.copy(duration = value) },
TwoValueCriterionModifiers,
),
FilterOption<GroupFilterType, IntCriterionInput>(
"o_counter",
R.string.stashapp_o_count,
null,
IntCriterionInput::class,
{ it.o_counter },
{ filter, value -> filter.copy(o_counter = value) },
TwoValueCriterionModifiers,
),
FilterOption<GroupFilterType, StringCriterionInput>(
"name",
R.string.stashapp_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ class ImageDetailsFragment : DetailsSupportFragment() {
StashCoroutineExceptionHandler(
Toast.makeText(
requireContext(),
getString(R.string.failed_o_counter),
getString(R.string.failed_update),
Toast.LENGTH_SHORT,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class OCounterPresenter(
) {
cardView.blackImageBackground = false

val text = cardView.context.getString(R.string.stashapp_o_counter)
val text = cardView.context.getString(R.string.stashapp_o_count)
cardView.titleText = "$text (${item.count})"
cardView.setMainImageDimensions(ActionPresenter.CARD_WIDTH, ActionPresenter.CARD_HEIGHT)
cardView.imageView.setPadding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ data class ComposeUiConfig(
val readOnlyModeEnabled: Boolean,
val showCardProgress: Boolean,
val playSoundOnFocus: Boolean,
val sfwMode: Boolean,
val persistVideoFilters: Boolean = true,
val cardSettings: CardUiSettings,
) {
Expand Down Expand Up @@ -46,6 +47,7 @@ data class ComposeUiConfig(
playSoundOnFocus = preferences.interfacePreferences.playMovementSounds,
readOnlyModeEnabled = preferences.pinPreferences.readOnlyPin.isNotNullOrBlank(),
persistVideoFilters = preferences.playbackPreferences.saveVideoFilters,
sfwMode = server.serverPreferences.sfwMode,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ val uiConfigPreview =
readOnlyModeEnabled = false,
showCardProgress = true,
playSoundOnFocus = true,
sfwMode = false,
cardSettings =
CardUiSettings(
maxSearchResults = 25,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ val iconOrder =
@Suppress("ktlint:standard:function-naming")
@Composable
fun IconRowText(
sfwMode: Boolean,
iconMap: EnumMap<DataType, Int>,
oCounter: Int?,
modifier: Modifier = Modifier,
Expand All @@ -186,7 +187,13 @@ fun IconRowText(
}
additionalIcons?.invoke(this)
if (oCounter != null && oCounter > 0) {
appendInlineContent(id = "ocounter", "O")
if (sfwMode) {
withStyle(SpanStyle(fontFamily = FontAwesome)) {
append(stringResource(R.string.fa_thumbs_up))
}
} else {
appendInlineContent(id = "ocounter", "O")
}
append(" $oCounter")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ fun GalleryCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
null,
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ fun GroupCard(
description = { focused ->
item?.let {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
null,
item.o_counter,
Modifier
.enableMarquee(focused)
.align(Alignment.Center),
Expand All @@ -102,6 +103,9 @@ fun GroupCard(
append(stringResource(R.string.fa_arrow_down_long))
}
}
if (item.o_counter != null && item.o_counter > 0) {
append(" ")
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ fun ImageCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
item?.o_counter ?: -1,
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fun MarkerCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
null,
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ fun PerformerCard(
subtitle = { Text(subtitle) },
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
item?.o_counter ?: -1,
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fun SceneCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
item?.o_counter ?: -1,
Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ fun StudioCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
null,
item?.o_counter,
Modifier
.enableMarquee(it)
.align(Alignment.Center),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ fun TagCard(
},
description = {
IconRowText(
sfwMode = uiConfig.sfwMode,
dataTypeMap,
null,
Modifier
Expand Down
Loading