feat(sync): nom par defaut neutre (data.json), et plus de clavier pendant une synchro

Un fichier nomme "vault-sync.json" annonce un coffre a qui parcourt la liste
des depots ; le contenu est chiffre, le nom ne l'etait pas. Les configurations
existantes gardent leur nom - c'est l'URL complete qui est enregistree - et le
QR du poste ne raccourcit plus que le nom par defaut courant, sinon le
telephone rallongerait vers un autre fichier.

Synchroniser coffre ferme ouvre d'abord le coffre : ce chemin depliait le
clavier de recherche au milieu d'une synchro.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-09-26 14:24:11 +01:00
parent a89e227272
commit 75a1169dc9
4 changed files with 33 additions and 13 deletions
+9 -4
View File
@@ -1448,16 +1448,21 @@ begin
var LShort := LQrUrl;
var LApi := Pos('/api/v1/repos/', LShort);
// GitHub : l'adresse du depot est sur github.com, l'API sur api.github.com.
// RACCOURCI SEULEMENT POUR LE NOM PAR DEFAUT COURANT. Un depot
// configure avec un autre nom - dont l'ancien vault-sync.json - voyage
// en URL complete : le telephone rallongerait sinon vers le defaut et
// les deux appareils ne regarderaient pas le meme fichier.
const SyncDefaultFile = '/contents/data.json';
if StartsText('https://api.github.com/repos/', LShort) and
EndsText('/contents/vault-sync.json', LShort) then
EndsText(SyncDefaultFile, LShort) then
LShort := 'https://github.com/' +
Copy(LShort, Length('https://api.github.com/repos/') + 1,
Length(LShort) - Length('https://api.github.com/repos/') -
Length('/contents/vault-sync.json'))
else if (LApi > 0) and EndsText('/contents/vault-sync.json', LShort) then
Length(SyncDefaultFile))
else if (LApi > 0) and EndsText(SyncDefaultFile, LShort) then
LShort := Copy(LShort, 1, LApi) +
Copy(LShort, LApi + Length('/api/v1/repos/'),
Length(LShort) - LApi - Length('/api/v1/repos/') - Length('/contents/vault-sync.json') + 1);
Length(LShort) - LApi - Length('/api/v1/repos/') - Length(SyncDefaultFile) + 1);
LShort := StringReplace(LShort, '%', '%25', [rfReplaceAll]);
LShort := StringReplace(LShort, '&', '%26', [rfReplaceAll]);
LShort := StringReplace(LShort, '#', '%23', [rfReplaceAll]);