Skip to content

Commit

Permalink
refactor: requested changes on mediainfo
Browse files Browse the repository at this point in the history
* Remove `Is AVC` field
* Refactor component population using loops
* General info of an element is always visible, not under tags
  • Loading branch information
ferferga committed Aug 15, 2023
1 parent 6743e96 commit dc69213
Show file tree
Hide file tree
Showing 9 changed files with 256 additions and 374 deletions.
85 changes: 42 additions & 43 deletions frontend/locales/en-US.json
Expand Up @@ -209,55 +209,54 @@
},
"manualLogin": "Manual login",
"mediaInfo": "Media Info",
"mediaInfoAudioChannelLayout": "Layout:",
"mediaInfoAudioChannels": "Channels:",
"mediaInfoAudioSampleRate": "Sample rate:",
"mediaInfoFileContainer": "Container:",
"mediaInfoFileFormats": "Format:",
"mediaInfoFilePath": "Path:",
"mediaInfoFileSize": "Size:",
"mediaInfoFileTitle": "Title:",
"mediaInfoGenericBitrate": "Bitrate:",
"mediaInfoGenericCodec": "Codec:",
"mediaInfoGenericCodecTag": "Codec tag:",
"mediaInfoGenericIsDefault": "Default:",
"mediaInfoGenericIsExternal": "External:",
"mediaInfoGenericIsForced": "Forced:",
"mediaInfoGenericLanguage": "Language:",
"mediaInfoGenericProfile": "Profile:",
"mediaInfoAudioChannelLayout": "Layout",
"mediaInfoAudioChannels": "Channels",
"mediaInfoAudioSampleRate": "Sample rate",
"mediaInfoAspectRatio": "Aspect ratio",
"mediaInfoFileContainer": "Container",
"mediaInfoFileFormats": "Format",
"mediaInfoFilePath": "Path",
"mediaInfoFileSize": "Size",
"mediaInfoFileTitle": "Title",
"mediaInfoGenericBitrate": "Bitrate",
"mediaInfoGenericCodec": "Codec",
"mediaInfoGenericCodecTag": "Codec tag",
"mediaInfoGenericIsDefault": "Default",
"mediaInfoGenericIsExternal": "External",
"mediaInfoGenericIsForced": "Forced",
"mediaInfoGenericLanguage": "Language",
"mediaInfoGenericProfile": "Profile",
"mediaInfoTitlesAudioCodec": "Audio | Audio {0}",
"mediaInfoTitlesEmbeddedImageCodec": "Image | Image {0}",
"mediaInfoTitlesSubtitleCodec": "Subtitle | Subtitle {0}",
"mediaInfoTitlesVideoCodec": "Video | Video {0}",
"mediaInfoVideoAspectRatio": "Aspect ratio:",
"mediaInfoVideoBitDepth": "Bit depth:",
"mediaInfoVideoBitrate": "Bitrate:",
"mediaInfoVideoColorPrimaries": "Color primaries:",
"mediaInfoVideoColorRange": "Color range:",
"mediaInfoVideoColorSpace": "Color space:",
"mediaInfoVideoColorTransfer": "Color transfer:",
"mediaInfoVideoDoViBlPresent": "DoVi BL present:",
"mediaInfoVideoDoViBlSignalCompatId": "DV bl signal compatibility ID:",
"mediaInfoVideoDoViElPresent": "DV el preset flag:",
"mediaInfoVideoDoViLevel": "DV level:",
"mediaInfoVideoDoViMajorVersion": "DV version major:",
"mediaInfoVideoDoViMinorVersion": "DV version minor:",
"mediaInfoVideoDoViProfile": "DV profile:",
"mediaInfoVideoDoViRpuPresent": "DV rpu preset flag:",
"mediaInfoVideoDoViTitle": "DV title:",
"mediaInfoVideoFrameRate": "Framerate:",
"mediaInfoVideoIsAnamorphic": "Anamorphic:",
"mediaInfoVideoIsAvc": "AVC:",
"mediaInfoVideoLevel": "Level:",
"mediaInfoVideoPixelFormat": "Pixel format:",
"mediaInfoVideoRange": "Video range:",
"mediaInfoVideoRangeType": "Video range type:",
"mediaInfoVideoRefFrames": "Ref frames:",
"mediaInfoVideoResolution": "Resolution:",
"mediaInfoVideoBitDepth": "Bit depth",
"mediaInfoVideoBitrate": "Bitrate",
"mediaInfoVideoColorPrimaries": "Color primaries",
"mediaInfoVideoColorRange": "Color range",
"mediaInfoVideoColorSpace": "Color space",
"mediaInfoVideoColorTransfer": "Color transfer",
"mediaInfoVideoDoViBlPresent": "DoVi BL present",
"mediaInfoVideoDoViBlSignalCompatId": "DV bl signal compatibility ID",
"mediaInfoVideoDoViElPresent": "DV el preset flag",
"mediaInfoVideoDoViLevel": "DV level",
"mediaInfoVideoDoViMajorVersion": "DV version major",
"mediaInfoVideoDoViMinorVersion": "DV version minor",
"mediaInfoVideoDoViProfile": "DV profile",
"mediaInfoVideoDoViRpuPresent": "DV rpu preset flag",
"mediaInfoVideoDoViTitle": "DV title",
"mediaInfoVideoFrameRate": "Framerate",
"mediaInfoVideoIsAnamorphic": "Anamorphic",
"mediaInfoVideoLevel": "Level",
"mediaInfoVideoPixelFormat": "Pixel format",
"mediaInfoVideoRange": "Video range",
"mediaInfoVideoRangeType": "Video range type",
"mediaInfoVideoRefFrames": "Ref frames",
"mediaInfoVideoResolution": "Resolution",
"mediaInfoVideoScanInterlaced": "Interlaced",
"mediaInfoVideoScanProgressive": "Progressive",
"mediaInfoVideoScanType": "Scan type:",
"mediaInfoVideoTimestamp": "Timestamp:",
"mediaInfoVideoScanType": "Scan type",
"mediaInfoVideoTimestamp": "Timestamp",
"menu": "Menu",
"metadata": {
"source": "Source",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Item/Identify/IdentifyDialog.vue
Expand Up @@ -4,7 +4,7 @@
:title="$t('identify')"
:subtitle="itemPath"
loading
@close="wrapClose">
@close="close">
<template #loader>
<v-progress-linear v-model="progress" :indeterminate="isLoading" />
</template>
Expand Down Expand Up @@ -102,7 +102,7 @@ const emit = defineEmits<{
close: [];
}>();
const wrapClose = (): void => {
const close = (): void => {
model.value = false;
emit('close');
};
Expand Down
40 changes: 15 additions & 25 deletions frontend/src/components/Item/MediaDetail/MediaDetailAttr.vue
@@ -1,39 +1,29 @@
<template>
<div class="d-flex flex-row">
<span class="mdinfo-label">{{ name + ' ' }}</span>
<span class="mdinfo-value">{{ parsedValue }}</span>
</div>
<p>
<b>{{ `${name}: ` }}</b>
<template v-if="!icon">
{{ value }}
</template>
<v-icon v-else :icon="icon" />
</p>
</template>

<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import IMdiCheck from 'virtual:icons/mdi/check';
import IMdiClose from 'virtual:icons/mdi/close';
import IMdiHelp from 'virtual:icons/mdi/help';
export interface MediaDetailAttribute {
const props = defineProps<{
name: string;
value?: string | number | boolean;
}
}>();
const props = defineProps<MediaDetailAttribute>();
const { t } = useI18n();
const parsedValue = computed(() => {
const icon = computed(() => {
if (typeof props.value === 'boolean') {
return props.value ? t('yes') : t('no');
return props.value ? IMdiCheck : IMdiClose;
}
return props.value ?? 'Unknown';
return props.value === 'undefined' ? IMdiHelp : undefined;
});
</script>

<style lang="scss" scoped>
.mdinfo-label {
display: inline-block;
font-weight: 600;
}
.mdinfo-value {
display: inline-block;
margin-left: 0.5rem;
font-weight: 400;
}
</style>

0 comments on commit dc69213

Please sign in to comment.