Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #182 from ttshivers/search_library
Browse files Browse the repository at this point in the history
Search tweaks
  • Loading branch information
ttshivers authored Sep 28, 2020
2 parents f80e701 + e9aadef commit 71ab10a
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/components/PlexOnDeck.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
>
<PlexThumbnail
:content="content"
:machine-identifier="machineIdentifier"
type="art"
cols="12"
sm="4"
Expand Down
1 change: 0 additions & 1 deletion src/components/PlexRecentlyAdded.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
>
<PlexThumbnail
:content="content"
:machine-identifier="machineIdentifier"
full-title
type="thumb"
cols="4"
Expand Down
35 changes: 25 additions & 10 deletions src/components/PlexThumbnail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,39 @@
>
<v-col
cols="12"
style="max-width: 100%;"
class="text-subtitle-2 text-truncate"
>
<div
class="text-subtitle-2 text-truncate"
>
{{ getTitle(content, fullTitle) }}
</div>
{{ getTitle(content, fullTitle) }}
</v-col>

<v-col
cols="12"
class="text-caption text-truncate text--secondary"
>
<div class="text-caption text-truncate text--secondary">
{{ getSecondaryTitle(content, fullTitle) }}
</div>
{{ getSecondaryTitle(content, fullTitle) }}
</v-col>

<v-col
v-if="content.reason"
cols="12"
class="text-caption text-truncate text--secondary"
>
{{ getReasonTitle(content) }}
</v-col>
</v-row>
</template>

<div>{{ getTitle(content, fullTitle) }}</div>

<div class="text-caption text--secondary">
{{ getSecondaryTitle(content, fullTitle) }}
</div>

<div
v-if="content.reason"
class="text-caption text--secondary"
>
{{ getSecondaryTitle(content, fullTitle) }}
{{ getReasonTitle(content) }}
</div>
</v-tooltip>
</v-card>
Expand Down Expand Up @@ -295,6 +304,12 @@ export default {
}
},
beforeDestroy() {
if (this.$el.vanillaTilt) {
this.$el.vanillaTilt.destroy();
}
},
methods: {
getImageUrl(width) {
return this.GET_MEDIA_IMAGE_URL({
Expand Down
8 changes: 7 additions & 1 deletion src/components/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

<v-list-item-content>
<v-list-item-title> {{ getTitle(item) }} </v-list-item-title>
<v-list-item-subtitle> {{ getSecondaryTitle(item) }} </v-list-item-subtitle>
<v-list-item-subtitle> {{ getItemSecondaryTitle(item) }} </v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
</template>
Expand Down Expand Up @@ -159,6 +159,12 @@ export default {
'SEARCH_PLEX_SERVER_HUB',
]),
getItemSecondaryTitle(item) {
return item.reason
? this.getReasonTitle(item)
: this.getSecondaryTitle(item);
},
getItemThumb({ type, thumb, grandparentThumb }) {
switch (type) {
case 'movie':
Expand Down
8 changes: 8 additions & 0 deletions src/utils/contenttitleutils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
const reasonWord = {
section: 'in',
actor: 'with',
director: 'by',
};

export default {
getTitle: (metadata, fullTitle) => {
switch (metadata.type) {
Expand Down Expand Up @@ -63,4 +69,6 @@ export default {
}
}
},

getReasonTitle: ({ reason, reasonTitle }) => `${reasonWord[reason]} ${reasonTitle}`,
};
1 change: 0 additions & 1 deletion src/views/PlexLibrary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
>
<PlexThumbnail
:content="content"
:machine-identifier="content.machineIdentifier"
type="thumb"
cols="4"
sm="3"
Expand Down
1 change: 0 additions & 1 deletion src/views/PlexSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
>
<PlexThumbnail
:content="item"
:machine-identifier="item.machineIdentifier"
show-server
type="thumb"
:cols="getHubCols(hub)"
Expand Down

0 comments on commit 71ab10a

Please sign in to comment.