pinokiod 8.0.106 → 8.0.108

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.
@@ -3407,7 +3407,6 @@ class Vault {
3407
3407
  status: PUBLIC_FILE_STATUS[row.status] || null
3408
3408
  }, this.locationForPath(row.path, row.source_id))),
3409
3409
  total: Number(result.total) || 0,
3410
- deduplicatable: Number(result.duplicateTotal) || 0,
3411
3410
  next_cursor: result.nextCursor || null
3412
3411
  }
3413
3412
  }
@@ -5691,18 +5691,9 @@ class RegistryCore {
5691
5691
  WHERE ${identityWhere}
5692
5692
  AND ${authorized.where.join(" AND ")}
5693
5693
  `).get(...identityValues, ...authorized.values).count) || 0
5694
- // Only paths still storing their own copy can free anything.
5695
- const duplicateTotal = Number(this.database.prepare(`
5696
- SELECT COUNT(*) AS count
5697
- FROM files child
5698
- WHERE ${identityWhere}
5699
- AND child.status = 'duplicate'
5700
- AND ${authorized.where.join(" AND ")}
5701
- `).get(...identityValues, ...authorized.values).count) || 0
5702
5694
  return {
5703
5695
  rows,
5704
5696
  total,
5705
- duplicateTotal,
5706
5697
  nextCursor: hasMore && last
5707
5698
  ? this.encodeCursor({
5708
5699
  sort: "file-locations",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "8.0.106",
3
+ "version": "8.0.108",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -1833,6 +1833,13 @@ class Server {
1833
1833
  const dev_initial_tab = type === "browse" && req.query && req.query.pinokio_dev_tab === "files"
1834
1834
  ? "files"
1835
1835
  : "plugins"
1836
+ // Disk Saver hands one content group to another app: the page opens with
1837
+ // its Disk Saver tab selected and that group already expanded.
1838
+ const vault_initial_group = req.query &&
1839
+ typeof req.query.vault_group === "string" &&
1840
+ /^[a-f0-9]{64}$/i.test(req.query.vault_group)
1841
+ ? req.query.vault_group.toLowerCase()
1842
+ : null
1836
1843
 
1837
1844
  const registryEnabled = await this.isRegistryEnabled().catch(() => false)
1838
1845
  let community_url = ""
@@ -1956,6 +1963,7 @@ class Server {
1956
1963
  tabs: savedTabs,
1957
1964
  editor_tab: editor_tab,
1958
1965
  dev_initial_tab,
1966
+ vault_initial_group,
1959
1967
  config,
1960
1968
  protection_enabled: protectionPreference ? protectionPreference.protection_enabled !== false : false,
1961
1969
  autolaunch_app: autolaunchAppState,
@@ -238,7 +238,7 @@ const COPY = {
238
238
  show_more_copies: "Show {count} more copies",
239
239
  loading_locations: "Loading locations…",
240
240
  open_in_disk_saver: "Open this file in Disk Saver",
241
- open_location_confirm: "Open Disk Saver for {location}?",
241
+ open_location_confirm: "Open Disk Saver to review {location}?",
242
242
  open_location_accept: "Open",
243
243
  show_more_locations: "Show {count} more locations",
244
244
  making_separate: "Making file separate",
@@ -658,26 +658,22 @@ const confirmLeave = (message, confirmLabel) => new Promise((resolve) => {
658
658
  const openGlobalWorkspace = () => {
659
659
  window.parent.location.assign("/vault")
660
660
  }
661
- // Opens a new tab rather than navigating: this workspace can be embedded in an
662
- // app page, where navigating would either nest a second copy of the interface
663
- // or drop the user out of the app they were looking at.
664
- // A copy that belongs to another app opens that app's own workspace, where it
665
- // can actually be acted on. Anything else — caches, external folders — has no
666
- // app page, so it opens the global one. Either way the user is leaving this
667
- // page, so it is confirmed first and the parent window is replaced rather than
668
- // nesting a second copy of the interface inside this frame.
661
+ // A copy in another app opens that app's page with its Disk Saver tab selected
662
+ // and the group expanded, because an app's workspace only exists inside that
663
+ // page; opening the workspace URL directly strands the user with no navigation.
664
+ // Locations that are not apps have no such page and open the global workspace.
665
+ // The label and kind travel with the row: an app workspace cannot look up
666
+ // sources belonging to other apps.
669
667
  const openContentGroup = async (group, kind, label) => {
670
- // The label and kind travel with the row: an app workspace cannot look up
671
- // sources belonging to other apps, so a lookup here would name every one of
672
- // them "unknown" and send them all to the global page.
673
- const app = kind === "app" && label ? label : null
674
- const name = label || COPY.unknown_location
675
668
  const accepted = await confirmLeave(
676
- COPY.open_location_confirm.replace("{location}", name),
669
+ COPY.open_location_confirm.replace(
670
+ "{location}", label || COPY.unknown_location),
677
671
  COPY.open_location_accept)
678
672
  if (!accepted) return
679
- const base = app ? `/vault/app/${encodeURIComponent(app)}` : "/vault"
680
- window.parent.location.assign(`${base}?group=${encodeURIComponent(group)}`)
673
+ const target = kind === "app" && label
674
+ ? `/pinokio/browser/${encodeURIComponent(label)}?vault_group=${encodeURIComponent(group)}`
675
+ : `/vault?group=${encodeURIComponent(group)}`
676
+ window.parent.location.assign(target)
681
677
  }
682
678
  const applyAutomaticScanSnapshot = (snapshot) => {
683
679
  if (!IS_APP_MODE || !AUTOMATIC_SUPPORTED) return
@@ -2968,9 +2964,6 @@ const loadPagedChildren = async (cache, key, buildUrl, append) => {
2968
2964
  const items = Array.isArray(result.items) ? result.items : []
2969
2965
  current.items = append ? current.items.concat(items) : items
2970
2966
  current.total = Math.max(0, Number(result.total) || 0)
2971
- // Location lists carry how many copies still cost space; group children
2972
- // do not, and read as zero.
2973
- current.deduplicatable = Math.max(0, Number(result.deduplicatable) || 0)
2974
2967
  current.nextCursor = result.next_cursor || null
2975
2968
  current.loaded = true
2976
2969
  } catch (error) {
@@ -8694,7 +8694,7 @@ body.dark .pinokio-custom-terminal-header {
8694
8694
  <% const vaultAutomaticSupported = typeof vault_automatic_supported === 'undefined' || vault_automatic_supported === true %>
8695
8695
  <% const vaultAutomaticResultSignature = vaultAutomaticSupported && typeof vault_automatic_result_signature === 'string' ? vault_automatic_result_signature : '' %>
8696
8696
  <% const vaultSidebarLabel = !vaultGlobalScanReady ? 'Disk Saver — Set up required' : vaultAutomaticSupported ? `Disk Saver — ${vaultAutomaticMode === 'automatic' ? 'Automatic' : 'Manual'} checking${vaultAutomaticResultSignature ? ' — Duplicate files found' : ''}` : 'Disk Saver' %>
8697
- <a id='save-space-tab' data-mode="refresh" target="app-vault" href="/vault/app/<%=encodeURIComponent(name)%>" class="btn header-item frame-link<%=vaultAutomaticResultSignature ? ' app-vault-result-attention' : ''%>" data-index="vault" data-static="retain" data-tab-link-popover="false" aria-label="<%=vaultSidebarLabel%>">
8697
+ <a id='save-space-tab' data-mode="refresh" target="app-vault" href="/vault/app/<%=encodeURIComponent(name)%><%=typeof vault_initial_group === 'string' && vault_initial_group ? `?group=${vault_initial_group}` : ''%>" class="btn header-item frame-link<%=vaultAutomaticResultSignature ? ' app-vault-result-attention' : ''%>" data-index="vault" data-static="retain" data-tab-link-popover="false" aria-label="<%=vaultSidebarLabel%>">
8698
8698
  <div class='tab'>
8699
8699
  <i class="fa-solid fa-hard-drive menu-action-leading-icon"></i>
8700
8700
  <div class='display'>Disk Saver</div>
@@ -9183,6 +9183,14 @@ body.dark .pinokio-custom-terminal-header {
9183
9183
  window.history.replaceState(window.history.state, "", `${devTabUrl.pathname}${devTabUrl.search}${devTabUrl.hash}`)
9184
9184
  } catch (_) {}
9185
9185
  <% } %>
9186
+ <% if (typeof vault_initial_group === 'string' && vault_initial_group) { %>
9187
+ global_selector = "#save-space-tab.frame-link"
9188
+ try {
9189
+ const vaultTabUrl = new URL(window.location.href)
9190
+ vaultTabUrl.searchParams.delete("vault_group")
9191
+ window.history.replaceState(window.history.state, "", `${vaultTabUrl.pathname}${vaultTabUrl.search}${vaultTabUrl.hash}`)
9192
+ } catch (_) {}
9193
+ <% } %>
9186
9194
  let pendingSelectionRetry = null
9187
9195
  let pendingHomeSelectionRetry = null
9188
9196
  let initialWorkspaceDiskUsageRequested = false
@@ -825,7 +825,6 @@ describe("Save Space interface", () => {
825
825
  relative_path: `models/${name}.bin`
826
826
  })),
827
827
  total: 3,
828
- deduplicatable: 1,
829
828
  next_cursor: null
830
829
  }
831
830
  }