Skip to content

Commit

Permalink
Add favorite indicator for tags & studios (#325)
Browse files Browse the repository at this point in the history
Adds the heart indicator to the overlay for favorite tag and studio
cards.

Requires server `v0.26.0`

Ref:
- stashapp/stash#4675
- stashapp/stash#4728
  • Loading branch information
damontecres committed Aug 29, 2024
1 parent 62913ef commit c087a0b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/src/main/graphql/FindStudios.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ fragment StudioData on Studio {
details
rating100
aliases
favorite
__typename
}
2 changes: 2 additions & 0 deletions app/src/main/graphql/Fragments.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ fragment SlimTagData on Tag {
id
name
description
favorite
image_path
}

fragment TagData on Tag {
id
name
description
favorite
aliases
scene_count
performer_count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class StudioPresenter(callback: LongClickCallBack<StudioData>? = null) :
}

cardView.setRating100(item.rating100)

if (item.favorite) {
cardView.setIsFavorite()
}
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class TagPresenter(callback: LongClickCallBack<TagData>? = null) :
if (item.image_path != null) {
loadImage(cardView, item.image_path)
}

if (item.favorite) {
cardView.setIsFavorite()
}
}

override fun getDefaultLongClickCallBack(cardView: StashImageCardView): LongClickCallBack<TagData> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ val FullSceneData.asVideoSceneData: VideoSceneData
)

val TagData.asSlimTagData: SlimTagData
get() = SlimTagData(id, name, description, image_path)
get() = SlimTagData(id, name, description, favorite, image_path)

val PerformerData.ageInYears: Int?
@RequiresApi(Build.VERSION_CODES.O)
Expand Down

0 comments on commit c087a0b

Please # to comment.