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