diff --git a/src/components/images/ImageEditor.vue b/src/components/images/ImageEditor.vue index 3e75dfca43964416d4c0a7aa0f37eec5f95efe7c..efb368fdcd59432d6e96eaa3b91cb05343e749c4 100644 --- a/src/components/images/ImageEditor.vue +++ b/src/components/images/ImageEditor.vue @@ -35,7 +35,7 @@ /> </FormGroup> - <AAttributionEditor v-model="image.contentLicense" /> + <AAttributionEditor v-model="image.licensing" /> </fieldset> </div> </template> diff --git a/src/components/images/ImagePickerDialog.vue b/src/components/images/ImagePickerDialog.vue index 4cb360d80cc8c50e5a877156f6a3034409906878..093f8a9282154f504331e9b8816df36d71b9c749 100644 --- a/src/components/images/ImagePickerDialog.vue +++ b/src/components/images/ImagePickerDialog.vue @@ -132,11 +132,11 @@ const { isProcessing: isSaving, fn: saveAndSelectImage } = useAsyncFunction( const data = new FormData() data.set('ppoi', image.ppoi) data.set('altText', image.altText ?? '') - data.set('contentLicense.licenseId', String(image.contentLicense?.licenseId ?? '')) - data.set('contentLicense.credits', image.contentLicense?.credits ?? '') + data.set('licensing.licenseId', String(image.licensing?.licenseId ?? '')) + data.set('licensing.credits', image.licensing?.credits ?? '') data.set( - 'contentLicense.isUseExplicitlyGrantedByAuthor', - image.contentLicense?.isUseExplicitlyGrantedByAuthor ? 'true' : 'false', + 'licensing.isUseExplicitlyGrantedByAuthor', + image.licensing?.isUseExplicitlyGrantedByAuthor ? 'true' : 'false', ) let newOrUpdatedImage: Image try { diff --git a/src/components/images/util.ts b/src/components/images/util.ts index 14b08aa4c07b771604673c4451804ea685f3e295..6d14eebc9cbcb6d345bcb6deeb4b7d521bb7ff68 100644 --- a/src/components/images/util.ts +++ b/src/components/images/util.ts @@ -69,7 +69,7 @@ export function newImage( file: File | Blob, originalImage?: Image | NewImage | undefined, ): NewImage { - const attribtion = originalImage?.contentLicense + const attribution = originalImage?.licensing return { url: URL.createObjectURL(file), @@ -78,10 +78,10 @@ export function newImage( ppoi: originalImage?.ppoi ?? '0.5x0.5', width: 0, height: 0, - contentLicense: { - licenseId: attribtion?.licenseId ?? null, - credits: attribtion?.credits ?? '', - isUseExplicitlyGrantedByAuthor: attribtion?.isUseExplicitlyGrantedByAuthor ?? false, + licensing: { + licenseId: attribution?.licenseId ?? null, + credits: attribution?.credits ?? '', + isUseExplicitlyGrantedByAuthor: attribution?.isUseExplicitlyGrantedByAuthor ?? false, }, } } diff --git a/src/components/license/AAttributionEditor.vue b/src/components/license/AAttributionEditor.vue index 861e040293d62785a38b8adac13f1d2c9ed36655..edcd89a7f82b2530fa07a5e3b48bb9723f31ebb2 100644 --- a/src/components/license/AAttributionEditor.vue +++ b/src/components/license/AAttributionEditor.vue @@ -43,20 +43,20 @@ import ADescription from '@/components/generic/ADescription.vue' import FormGroup from '@/components/generic/FormGroup.vue' import { useLicenseStore } from '@/stores' import { useLicenseValidator, useSelectedLicense } from '@/stores/licenses' -import { ContentLicense } from '@/types' +import { Licensing } from '@/types' import { computed } from 'vue' import { useCopy } from '@/form' import { useI18n } from '@/i18n' -const _attribution = defineModel<ContentLicense | null>({ required: true }) -const defaultAttribution: ContentLicense = { +const _attribution = defineModel<Licensing | null>({ required: true }) +const defaultAttribution: Licensing = { licenseId: null, credits: '', isUseExplicitlyGrantedByAuthor: false, } -const attribution = computed<ContentLicense>({ +const attribution = computed<Licensing>({ get: () => _attribution.value ?? { ...defaultAttribution }, - set: (value: ContentLicense) => { + set: (value: Licensing) => { _attribution.value = value }, }) @@ -64,7 +64,7 @@ const attribution = computed<ContentLicense>({ const { t } = useI18n() const licenseStore = useLicenseStore() -function writeBack<T extends keyof ContentLicense>(prop: T, value: ContentLicense[T]): void { +function writeBack<T extends keyof Licensing>(prop: T, value: Licensing[T]): void { attribution.value = { ...attribution.value, [prop]: value } } diff --git a/src/steering-types.ts b/src/steering-types.ts index a1c446361fef167f95d481ee91517993853c5c32..1a46581c73ded5d69ae5a8ec137d4ca46b225d00 100644 --- a/src/steering-types.ts +++ b/src/steering-types.ts @@ -1,6 +1,6 @@ /* eslint-disable */ /* - * This file was auto-generated by `make update-types` at 2025-01-24 12:56:47.495Z. + * This file was auto-generated by `make update-types` at 2025-01-30 23:50:29.932Z. * DO NOT make changes to this file. */ @@ -609,14 +609,6 @@ export interface components { timeslotId: number episodeId: number | null } - ContentLicense: { - /** @description Credits of the content. */ - credits?: string - /** @description True if use is explicitly granted by author. */ - isUseExplicitlyGrantedByAuthor?: boolean - /** @description `License` ID for this content */ - licenseId?: number | null - } DryRunTimeSlot: { id: number | null scheduleId: number | null @@ -695,8 +687,8 @@ export interface components { Image: { /** @description Alternate text for the image. */ altText?: string - /** @description `ContentLicense` object. */ - contentLicense?: components['schemas']['ContentLicense'] | null + /** @description `Licensing` object. */ + licensing?: components['schemas']['Licensing'] | null /** * Format: uri * @description The URI of the image. @@ -736,6 +728,14 @@ export interface components { */ url?: string } + Licensing: { + /** @description Credits of the content. */ + credits?: string + /** @description True if use is explicitly granted by author. */ + isUseExplicitlyGrantedByAuthor?: boolean + /** @description `License` ID for this content */ + licenseId?: number | null + } LinkType: { id: number /** @description True if link type is active. */ @@ -758,6 +758,8 @@ export interface components { } MediaSource: { id: number + /** @description `Licensing` object. */ + licensing?: components['schemas']['Licensing'] | null mediaId: number /** Format: double */ duration?: number | null @@ -959,8 +961,8 @@ export interface components { PatchedImage: { /** @description Alternate text for the image. */ altText?: string - /** @description `ContentLicense` object. */ - contentLicense?: components['schemas']['ContentLicense'] | null + /** @description `Licensing` object. */ + licensing?: components['schemas']['Licensing'] | null /** * Format: uri * @description The URI of the image. @@ -1022,6 +1024,8 @@ export interface components { } PatchedMediaSource: { id?: number + /** @description `Licensing` object. */ + licensing?: components['schemas']['Licensing'] | null mediaId?: number /** Format: double */ duration?: number | null @@ -1772,6 +1776,7 @@ export interface components { | 'program.add_language' | 'program.add_license' | 'program.add_licensetype' + | 'program.add_licensing' | 'program.add_linktype' | 'program.add_media' | 'program.add_mediasource' @@ -1803,6 +1808,7 @@ export interface components { | 'program.change_language' | 'program.change_license' | 'program.change_licensetype' + | 'program.change_licensing' | 'program.change_linktype' | 'program.change_media' | 'program.change_mediasource' @@ -1839,6 +1845,7 @@ export interface components { | 'program.delete_language' | 'program.delete_license' | 'program.delete_licensetype' + | 'program.delete_licensing' | 'program.delete_linktype' | 'program.delete_media' | 'program.delete_mediasource' @@ -1925,6 +1932,7 @@ export interface components { | 'program.edit__show__slug' | 'program.edit__show__topics' | 'program.edit__show__type' + | 'program.edit__timeslot__episode' | 'program.edit__timeslot__memo' | 'program.edit__timeslot__playlist' | 'program.edit__timeslot__playlist_id' @@ -1950,6 +1958,7 @@ export interface components { | 'program.view_language' | 'program.view_license' | 'program.view_licensetype' + | 'program.view_licensing' | 'program.view_linktype' | 'program.view_media' | 'program.view_mediasource' diff --git a/src/types.ts b/src/types.ts index fe8c68e21137b4b336e1ca7f88ed0fe5793c8865..e00239bfc74c0ef119973fc4df990d12ad0a8ac9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -43,7 +43,7 @@ export type Episode = Required<_Episode> export type EpisodeCreateData = Omit<_Episode, _EpisodeReadonlyAttrs> export type EpisodeUpdateData = Partial<EpisodeCreateData> -export type ContentLicense = steeringComponents['schemas']['ContentLicense'] +export type Licensing = steeringComponents['schemas']['Licensing'] type _Image = steeringComponents['schemas']['Image'] type _ImageReadonlyAttrs = ReadonlyAttrs | 'height' | 'width' | 'image' | 'url'