Changes for page Linkding + SingleFile Archief
Last modified by XWikiGuest on 2026/03/11 21:04
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -129,8 +129,13 @@ 129 129 130 130 function ldsfLoadBookmarks() { 131 131 var apiUrl = LDSF_LINKDING_URL + '?limit=' + LDSF_COUNT + '&q=%23' + encodeURIComponent(LDSF_TAG); 132 + console.log('Fetching bookmarks:', apiUrl); 132 132 fetch(apiUrl, { headers: { 'Authorization': 'Token ' + LDSF_TOKEN } }) 133 - .then(function(r) { return r.json(); }) 134 + .then(function(r) { 135 + console.log('Linkding response status:', r.status, r.headers.get('content-type')); 136 + if (!r.ok) return r.text().then(function(t) { throw new Error('HTTP ' + r.status + ': ' + t.substring(0, 200)); }); 137 + return r.json(); 138 + }) 134 134 .then(function(data) { 135 135 var total = data.count || 0; 136 136 var archiveCount = 0; ... ... @@ -172,7 +172,7 @@ 172 172 173 173 // Debug test button 174 174 document.getElementById('ldsf-test-btn').addEventListener('click', function() { 175 - alert(' Klik werkt!archiveMapkeys: ' + Object.keys(ldsf_archiveMap).join(','));180 + alert('archiveMap: ' + JSON.stringify(ldsf_archiveMap) + '\nurlToFile: ' + JSON.stringify(ldsf_urlToFile)); 176 176 }); 177 177 178 178 // Load index then bookmarks ... ... @@ -179,10 +179,11 @@ 179 179 fetch(LDSF_WEBDAV + 'index.json', { headers: { 'Authorization': LDSF_AUTH } }) 180 180 .then(function(r) { return r.ok ? r.json() : {}; }) 181 181 .then(function(idx) { 187 + console.log('SingleFile index loaded:', idx); 182 182 Object.keys(idx).forEach(function(f) { ldsf_urlToFile[idx[f]] = f; }); 183 183 ldsfLoadBookmarks(); 184 184 }) 185 -.catch(function() { ldsfLoadBookmarks(); }); 191 +.catch(function(err) { console.log('SingleFile index FAILED:', err); ldsfLoadBookmarks(); }); 186 186 </script> 187 187 {{/html}} 188 188