mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 13:30:23 +01:00
fix: thumb remove on windows, closes #11357
This commit is contained in:
@@ -52,6 +52,7 @@ Thumbs.get = async function (tids) {
|
||||
const name = path.basename(thumb);
|
||||
return hasTimestampPrefix.test(name) ? name.slice(14) : name;
|
||||
})(),
|
||||
path: thumb,
|
||||
url: thumb.startsWith('http') ? thumb : path.posix.join(upload_url, thumb),
|
||||
})));
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="alert alert-info">[[modules:thumbs.modal.no-thumbs]]</div>
|
||||
{{{ end }}}
|
||||
{{{ each thumbs }}}
|
||||
<div class="media" data-id="{./id}" data-path="{./url}">
|
||||
<div class="media" data-id="{./id}" data-path="{./path}">
|
||||
<div class="media-left">
|
||||
<img class="media-object" src="{./url}" alt="" />
|
||||
</div>
|
||||
|
||||
@@ -82,6 +82,7 @@ describe('Topic thumbs', () => {
|
||||
assert.deepStrictEqual(thumbs, [{
|
||||
id: topicObj.topicData.tid,
|
||||
name: 'test.png',
|
||||
path: `${relativeThumbPaths[0]}`,
|
||||
url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`,
|
||||
}]);
|
||||
});
|
||||
@@ -92,6 +93,7 @@ describe('Topic thumbs', () => {
|
||||
[{
|
||||
id: topicObj.topicData.tid,
|
||||
name: 'test.png',
|
||||
path: `${relativeThumbPaths[0]}`,
|
||||
url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`,
|
||||
}],
|
||||
[],
|
||||
@@ -200,16 +202,19 @@ describe('Topic thumbs', () => {
|
||||
{
|
||||
id: tid,
|
||||
name: 'test.png',
|
||||
path: relativeThumbPaths[0],
|
||||
url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[0]}`,
|
||||
},
|
||||
{
|
||||
id: tid,
|
||||
name: 'example.org',
|
||||
path: 'https://example.org',
|
||||
url: 'https://example.org',
|
||||
},
|
||||
{
|
||||
id: tid,
|
||||
name: 'test2.png',
|
||||
path: relativeThumbPaths[1],
|
||||
url: `${nconf.get('relative_path')}${nconf.get('upload_url')}${relativeThumbPaths[1]}`,
|
||||
},
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user