diff --git a/composables/helper.ts b/composables/helper.ts index 56d16cb9..cc715407 100644 --- a/composables/helper.ts +++ b/composables/helper.ts @@ -79,6 +79,21 @@ export const stringFormatter = () => { } } + function parent(path: string) { + if (path) { + const pathArr = path.split('/') + pathArr.pop() + + if (pathArr.length > 0) { + return pathArr.join('/') + } else { + return '/' + } + } else { + return '' + } + } + function toMin(sec: number) { if (sec) { const minutes = Math.floor(sec / 60) @@ -154,6 +169,7 @@ export const stringFormatter = () => { numberToHex, hexToNumber, filename, + parent, toMin, secondsToTime, mediaType, diff --git a/pages/media.vue b/pages/media.vue index 15df5cd4..37f79da8 100644 --- a/pages/media.vue +++ b/pages/media.vue @@ -1,18 +1,21 @@