Commit 782a243b7f
782a243b7fd47572586aa509a8dbd3329e11becf
parent: d79085856c
Unsigned
Duck <57977673+woducku@users.noreply.github.com> · 2026-10-13 01:48 UTC
mixed
Layout: unified · split
docs/.vitepress/theme/components/extrepo/ExtensionRepos.vue
+1
| @@ -196,6 +196,7 @@ const { facets, isFiltering, filteredSites } = useRepoFilter(allSites, { |
| 196 | 196 | :available-langs="facets.availableLangs" |
| 197 | 197 | :has-multi-language="facets.hasMultiLanguage" |
| 198 | 198 | :has-ratings="facets.hasRatings" |
| 199 | :has-mixed="facets.hasMixed" |
| 199 | 200 | :has-suggestive="facets.hasSuggestive" |
| 200 | 201 | :available-content-types="facets.availableContentTypes" |
| 201 | 202 | :has-content-types="facets.availableContentTypes.length > 0" |
docs/.vitepress/theme/components/extrepo/SettingsMenu.vue
+16 −5
| @@ -11,6 +11,7 @@ const props = defineProps<{ |
| 11 | 11 | availableLangs: string[] |
| 12 | 12 | hasMultiLanguage: boolean |
| 13 | 13 | hasRatings: boolean |
| 14 | hasMixed: boolean |
| 14 | 15 | hasSuggestive: boolean |
| 15 | 16 | contentTypeFilter: string |
| 16 | 17 | availableContentTypes: string[] |
| @@ -110,8 +111,14 @@ const ratingOptions = computed<FilterOption[]>(() => { |
| 110 | 111 | { value: 'all', label: 'All' }, |
| 111 | 112 | { value: 'safe', label: 'Safe' } |
| 112 | 113 | ] |
| 113 | | if (props.hasSuggestive) opts.push({ value: 'suggestive', label: 'Mature' }) |
| 114 | | opts.push({ value: 'nsfw', label: props.hasSuggestive ? 'Adult' : 'NSFW' }) |
| 114 | if (props.hasMixed) opts.push({ value: 'mixed', label: 'Mixed' }) |
| 115 | if (props.hasSuggestive) { |
| 116 | opts.push({ value: 'suggestive', label: 'Mature' }) |
| 117 | } |
| 118 | opts.push({ |
| 119 | value: 'nsfw', |
| 120 | label: props.hasMixed || props.hasSuggestive ? 'Adult' : 'NSFW' |
| 121 | }) |
| 115 | 122 | return opts |
| 116 | 123 | }) |
| 117 | 124 | |
| @@ -149,7 +156,7 @@ const typeTrigger = computed(() => |
| 149 | 156 | ref="menuRef" |
| 150 | 157 | class="ext-settings-menu VPMenu" |
| 151 | 158 | :class="{ |
| 152 | | 'ext-settings-menu--wide': hasSuggestive || hasContentTypes |
| 159 | 'ext-settings-menu--wide': hasMixed || hasSuggestive || hasContentTypes |
| 153 | 160 | }" |
| 154 | 161 | :style="menuStyle" |
| 155 | 162 | > |
| @@ -182,12 +189,16 @@ const typeTrigger = computed(() => |
| 182 | 189 | <strong>Safe</strong> |
| 183 | 190 | <span>Only entries with no mature content</span> |
| 184 | 191 | </div> |
| 192 | <div v-if="hasMixed" class="rating-help-option"> |
| 193 | <strong>Mixed</strong> |
| 194 | <span>Includes mixed content</span> |
| 195 | </div> |
| 185 | 196 | <div v-if="hasSuggestive" class="rating-help-option"> |
| 186 | 197 | <strong>Mature</strong> |
| 187 | | <span>Includes suggestive content</span> |
| 198 | <span>Includes mature content</span> |
| 188 | 199 | </div> |
| 189 | 200 | <div class="rating-help-option"> |
| 190 | | <strong>{{ hasSuggestive ? 'Adult' : 'NSFW' }}</strong> |
| 201 | <strong>{{ hasMixed || hasSuggestive ? 'Adult' : 'NSFW' }}</strong> |
| 191 | 202 | <span>Includes explicit adult content</span> |
| 192 | 203 | </div> |
| 193 | 204 | </div> |
docs/.vitepress/theme/components/extrepo/SiteGroupCell.vue
+2 −1
| @@ -19,7 +19,8 @@ defineEmits<{ |
| 19 | 19 | const primary = computed(() => props.sites[0]) |
| 20 | 20 | const highestRated = computed(() => |
| 21 | 21 | props.sites.find(site => site.rating === 'nsfw') ?? |
| 22 | | props.sites.find(site => site.rating === 'suggestive') |
| 22 | props.sites.find(site => site.rating === 'suggestive') ?? |
| 23 | props.sites.find(site => site.rating === 'mixed') |
| 23 | 24 | ) |
| 24 | 25 | |
| 25 | 26 | const groupName = computed(() => { |
docs/.vitepress/theme/components/extrepo/helpers.ts
+3 −1
| @@ -69,7 +69,9 @@ export function ratingIcon(rating: Rating): string { |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | export function ratingTitle(rating: Rating): string { |
| 72 | | return rating === 'nsfw' ? 'NSFW' : 'Mature' |
| 72 | if (rating === 'nsfw') return 'NSFW' |
| 73 | if (rating === 'suggestive') return 'Mature' |
| 74 | return 'Mixed' |
| 73 | 75 | } |
| 74 | 76 | |
| 75 | 77 | export function contentTypeLabel(type: string): string { |
docs/.vitepress/theme/components/extrepo/types.ts
+1 −1
| @@ -1,4 +1,4 @@ |
| 1 | | export type Rating = 'safe' | 'suggestive' | 'nsfw' |
| 1 | export type Rating = 'safe' | 'mixed' | 'suggestive' | 'nsfw' |
| 2 | 2 | export type RatingFilter = 'all' | Rating |
| 3 | 3 | |
| 4 | 4 | export interface RepoVariant { |
docs/.vitepress/theme/components/extrepo/useRepoFilter.ts
+3
| @@ -30,12 +30,14 @@ export function useRepoFilter( |
| 30 | 30 | const contentTypes = new Set<string>() |
| 31 | 31 | const langs = new Set<string>() |
| 32 | 32 | let hasRatings = false |
| 33 | let hasMixed = false |
| 33 | 34 | let hasSuggestive = false |
| 34 | 35 | let hasMultiLanguage = false |
| 35 | 36 | let hasBroken = false |
| 36 | 37 | for (const site of allSites.value) { |
| 37 | 38 | if (site.contentType) contentTypes.add(site.contentType) |
| 38 | 39 | if (site.rating !== 'safe') hasRatings = true |
| 40 | if (site.rating === 'mixed') hasMixed = true |
| 39 | 41 | if (site.rating === 'suggestive') hasSuggestive = true |
| 40 | 42 | if (site.isBroken) hasBroken = true |
| 41 | 43 | if (typeof site.lang !== 'string') continue |
| @@ -48,6 +50,7 @@ export function useRepoFilter( |
| 48 | 50 | langLabel(a).localeCompare(langLabel(b)) |
| 49 | 51 | ), |
| 50 | 52 | hasRatings, |
| 53 | hasMixed, |
| 51 | 54 | hasSuggestive, |
| 52 | 55 | hasMultiLanguage, |
| 53 | 56 | hasBroken |
docs/ext/extensionRepos/parsers.ts
+2 −2
| @@ -299,7 +299,7 @@ function repoListLabel(indexUrl: string, repoJson: unknown): string { |
| 299 | 299 | |
| 300 | 300 | function ratingFromLevel(level: number): Rating { |
| 301 | 301 | if (level >= 2) return 'nsfw' |
| 302 | | if (level >= 1) return 'suggestive' |
| 302 | if (level >= 1) return 'mixed' |
| 303 | 303 | return 'safe' |
| 304 | 304 | } |
| 305 | 305 | |
| @@ -764,7 +764,7 @@ function toRepoDataLNReader(plugins: LNReaderPlugin[]): RepoSite[] { |
| 764 | 764 | |
| 765 | 765 | const CONTENT_WARNING_RATING: Record<string, Rating> = { |
| 766 | 766 | CONTENT_WARNING_NSFW: 'nsfw', |
| 767 | | CONTENT_WARNING_MIXED: 'suggestive', |
| 767 | CONTENT_WARNING_MIXED: 'mixed', |
| 768 | 768 | CONTENT_WARNING_SAFE: 'safe' |
| 769 | 769 | } |
| 770 | 770 | |