@soffits/dsh-media-hub 0.15.2 → 0.15.3

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/locale/en.json CHANGED
@@ -310,6 +310,8 @@
310
310
  "points.newSeries": "Start a new series",
311
311
  "points.newSeriesAbout": "Begin watching a series that is new to the library. Going on with one stays free.",
312
312
  "points.bingeNight": "Binge night",
313
- "points.bingeNightAbout": "Start watching late at night, as often as you like, until morning."
313
+ "points.bingeNightAbout": "Start watching late at night, as often as you like, until morning.",
314
+ "page.crashed": "This page stopped working.",
315
+ "page.reload": "Reload"
314
316
  }
315
317
  }
package/locale/fr.json CHANGED
@@ -310,6 +310,8 @@
310
310
  "points.newSeries": "Commencer une nouvelle série",
311
311
  "points.newSeriesAbout": "Commencer une série qui n’est pas encore dans la bibliothèque. Continuer une série reste gratuit.",
312
312
  "points.bingeNight": "Nuit de marathon",
313
- "points.bingeNightAbout": "Lancer des épisodes tard dans la nuit, autant que vous voulez, jusqu’au matin."
313
+ "points.bingeNightAbout": "Lancer des épisodes tard dans la nuit, autant que vous voulez, jusqu’au matin.",
314
+ "page.crashed": "Cette page a cessé de fonctionner.",
315
+ "page.reload": "Recharger"
314
316
  }
315
317
  }
package/locale/zh.json CHANGED
@@ -310,6 +310,8 @@
310
310
  "points.newSeries": "开一部新剧",
311
311
  "points.newSeriesAbout": "开始看一部库里还没有的剧。接着看已有的剧不花分。",
312
312
  "points.bingeNight": "通宵追剧夜",
313
- "points.bingeNightAbout": "深夜开播,想看几次都行,到早上为止。"
313
+ "points.bingeNightAbout": "深夜开播,想看几次都行,到早上为止。",
314
+ "page.crashed": "页面出错了。",
315
+ "page.reload": "重新加载"
314
316
  }
315
317
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soffits/dsh-media-hub",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "A media hub for DeepSeek Harness: search shows, novels, ebooks and papers across sources, watch together in sync, and download books in the format you want onto your own shelf.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Catches an error thrown while the page draws, so the panel says what broke and offers a reload
3
+ * (which also picks up modules changed by an update) instead of going blank.
4
+ */
5
+ export function createBoundary(React) {
6
+ const h = React.createElement
7
+ return class PageBoundary extends React.Component {
8
+ constructor(props) {
9
+ super(props)
10
+ this.state = { error: null }
11
+ }
12
+
13
+ static getDerivedStateFromError(error) {
14
+ return { error }
15
+ }
16
+
17
+ componentDidCatch(error, info) {
18
+ console.error('[media-hub] the page crashed: %s', error?.message, info?.componentStack ?? '')
19
+ }
20
+
21
+ render() {
22
+ const { error } = this.state
23
+ if (error === null) return this.props.children
24
+ const { t } = this.props
25
+ return h('div', { className: 'vsync-crash', role: 'alert' },
26
+ h('p', null, t('page.crashed')),
27
+ h('p', { className: 'vsync-error' }, String(error?.message ?? error)),
28
+ h('button', { type: 'button', className: 'vsync-crash-reload', onClick: () => location.reload() }, t('page.reload')))
29
+ }
30
+ }
31
+ }
@@ -185,7 +185,7 @@ function ShowRow({ t, show, days, onOpen, onChanged, onOpenWork }) {
185
185
  { label: t('library.rename'), onSelect: () => setMode('rename') },
186
186
  show.sourced && !show.pinned && show.episodes < show.total && { label: t('library.downloadAll'), onSelect: () => setMode('pin') },
187
187
  show.pinned && { label: t('library.stopOffline'), onSelect: () => act(async () => post('library/pin', await asViewer(t, { path: show.path, pinned: false }))) },
188
- days > 0 && show.deletesAt === null && { label: fill(t('library.startCountdown'), { n: days }), onSelect: () => act(async () => post('library/countdown', await asViewer(t, { path: show.path }))) },
188
+ show.autoDeletes && show.deletesAt === null && { label: fill(t('library.startCountdown'), { n: days }), onSelect: () => act(async () => post('library/countdown', await asViewer(t, { path: show.path }))) },
189
189
  show.source?.source && show.sourced && { label: t(show.follow ? 'follow.stop' : 'follow.follow'), onSelect: () => act(() => post('follow', { source: show.source.source, id: show.source.id, follow: !show.follow })) },
190
190
  show.download?.status === 'failed' && { label: t('library.retry'), onSelect: () => act(() => post('library/retry', { path: show.path })) },
191
191
  show.download?.active && { label: t('library.stopDownload'), onSelect: () => act(() => post('library/cancel', { path: show.path })) },
package/web/panel.css CHANGED
@@ -1,5 +1,6 @@
1
1
  /* Video Sync page styles. Only the host theme tokens (--dsw-*), except the player's stage. */
2
2
  .vsync-page{width:100%;min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-base);font-size:14px;line-height:1.6;display:flex;flex-direction:column;overflow:hidden}
3
+ .vsync-crash{padding:24px;display:flex;flex-direction:column;align-items:flex-start;gap:8px}
3
4
  .vsync-scroll{flex:1;min-height:0;overflow:auto;scrollbar-gutter:stable;--dsh-scrollbar-width:9px;--dsh-scrollbar-thumb-border:2px}
4
5
  .vsync-content{max-width:960px;margin:0 auto;padding:0 clamp(24px,4vw,48px) 48px}
5
6
  @media (width<=767px){.vsync-content{padding-inline:20px}}