@saooti/octopus-sdk 38.0.19 → 38.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "38.0.19",
3
+ "version": "38.0.21",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -6,14 +6,15 @@
6
6
  >
7
7
  <template #body>
8
8
  <div class="d-flex flex-column">
9
- <a
9
+ <button
10
10
  v-for="(chapter, index) in playerChapteringPercent"
11
11
  :key="chapter"
12
- class="c-hand text-truncate mb-1"
12
+ class="btn d-flex flex-nowrap align-items-center p-2 mt-1 c-hand text-truncate mb-1 border"
13
13
  @click="goToChapter(index)"
14
14
  >
15
- {{ chapter.startTime + " - " + chapter.title }}
16
- </a>
15
+ <div class="me-auto">{{ index + 1 + " - " + chapter.title }}</div>
16
+ <div>{{ chapter.startDisplay }}</div>
17
+ </button>
17
18
  </div>
18
19
  </template>
19
20
  <template #footer>
@@ -4,11 +4,14 @@
4
4
  class="btn-transparent d-flex align-items-center text-truncate medium-text text-light"
5
5
  @click="showChaptering = !showChaptering"
6
6
  >
7
- <div class="text-truncate">{{ "• " + actualChapter.title }}</div>
7
+ <div class="text-truncate">
8
+ {{ actualIndex + 1 + " - " + actualChapter.title }}
9
+ </div>
8
10
  <span class="saooti-right small-text" />
9
11
  </button>
10
12
  <ChapteringModal v-if="showChaptering" @close="showChaptering = false" />
11
13
  </div>
14
+ <div v-else class="margin-chaptering"></div>
12
15
  </template>
13
16
  <script lang="ts">
14
17
  import { ChapterPercent } from "@/stores/class/chaptering/chaptering";
@@ -27,6 +30,7 @@ export default defineComponent({
27
30
  data() {
28
31
  return {
29
32
  actualChapter: undefined as ChapterPercent | undefined,
33
+ actualIndex: 0 as number,
30
34
  showChaptering: false as boolean,
31
35
  };
32
36
  },
@@ -57,9 +61,12 @@ export default defineComponent({
57
61
  this.isInChapter(progressPercent, this.playerChapteringPercent[i])
58
62
  ) {
59
63
  this.actualChapter = this.playerChapteringPercent[i];
64
+ this.actualIndex = i;
60
65
  return;
61
66
  }
62
67
  }
68
+ this.actualChapter = undefined;
69
+ this.actualIndex = 0;
63
70
  },
64
71
  },
65
72
  },
@@ -70,3 +77,10 @@ export default defineComponent({
70
77
  },
71
78
  });
72
79
  </script>
80
+ <style lang="scss">
81
+ .octopus-app {
82
+ .margin-chaptering{
83
+ height: 23px;
84
+ }
85
+ }
86
+ </style>
@@ -153,10 +153,10 @@ export default defineComponent({
153
153
  background: #282828 !important;
154
154
  font-size: 1rem;
155
155
  .medium-text {
156
- font-size: 0.75rem;
156
+ font-size: 0.65rem;
157
157
  }
158
158
  .small-text {
159
- font-size: 0.6rem;
159
+ font-size: 0.5rem;
160
160
  }
161
161
 
162
162
  @media (max-width: 960px) {
@@ -13,6 +13,6 @@ export default {
13
13
  const hours = Math.floor(totalSeconds / 3600);
14
14
  const minutes = Math.floor((totalSeconds - hours * 3600) / 60);
15
15
  const seconds = totalSeconds - hours * 3600 - minutes * 60;
16
- return (hours > 0? this.formatToString(hours)+separator:"") + this.formatToString(minutes) +separator+ this.formatToString(seconds) + (isLast?separator:separator );
16
+ return (hours > 0? this.formatToString(hours)+separator:"") + this.formatToString(minutes) +separator+ this.formatToString(seconds) + (isLast?separator:'' );
17
17
  },
18
18
  };
@@ -46,14 +46,14 @@ export const usePlayerStore = defineStore("PlayerStore", {
46
46
  if(!this.playerChaptering || 0===this.playerTotal){
47
47
  return;
48
48
  }
49
- const chapteringKeys = Object.keys(this.playerChaptering);
50
49
  let chapteringPercent: ChapteringPercent = [];
51
- for (let i = 0, len = chapteringKeys.length; i < len; i++) {
50
+ for (let i = 0, len = this.playerChaptering.chapters.length; i < len; i++) {
52
51
  chapteringPercent.push({
53
- startTime : chapteringKeys[i],
54
- startPercent: (DurationHelper.convertTimestamptoSeconds(chapteringKeys[i]) * 100 ) / (Math.round(this.playerTotal)),
52
+ startTime : this.playerChaptering.chapters[i].startTime,
53
+ startDisplay: DurationHelper.formatDuration(this.playerChaptering.chapters[i].startTime, ':', false),
54
+ startPercent: (this.playerChaptering.chapters[i].startTime * 100 ) / (Math.round(this.playerTotal)),
55
55
  endPercent:100,
56
- title: this.playerChaptering[chapteringKeys[i]]
56
+ title: this.playerChaptering.chapters[i].title
57
57
  });
58
58
  }
59
59
  for (let i = 0, len = chapteringPercent.length; i < len; i++) {
@@ -1,12 +1,23 @@
1
+ //https://github.com/Podcastindex-org/podcast-namespace/blob/main/chapters/jsonChapters.md
1
2
  export interface Chaptering {
2
- [startTime: string] : string;
3
+ version: string;
4
+ chapters: Array<Chapter>;
5
+ }
6
+
7
+ export interface Chapter{
8
+ startTime: number;
9
+ title: string;
10
+ img?: string;
11
+ url?:string
3
12
  }
4
13
 
5
14
  export interface ChapterPercent {
6
- startTime: string;
15
+ startTime: number;
16
+ startDisplay: string;
7
17
  startPercent: number;
8
18
  endPercent: number;
9
19
  title: string;
10
20
  }
11
21
 
22
+
12
23
  export type ChapteringPercent = Array<ChapterPercent>;