Include bagname in tiddler Etags

This commit is contained in:
Jeremy Ruston
2024-03-20 18:52:54 +00:00
parent 808b94468e
commit eaebeb87c9
8 changed files with 43 additions and 16 deletions

View File

@@ -244,7 +244,7 @@ Get an attachment ready to stream. Returns null if there is an error or:
tiddler_id: revision of tiddler
stream: stream of file
type: type of file
Returns {tiddler_id:}
Returns {tiddler_id:,bag_name:}
*/
SqlTiddlerStore.prototype.getBagTiddlerStream = function(title,bag_name) {
const tiddlerInfo = this.sqlTiddlerDatabase.getBagTiddler(title,bag_name);
@@ -253,7 +253,10 @@ SqlTiddlerStore.prototype.getBagTiddlerStream = function(title,bag_name) {
return $tw.utils.extend(
{},
this.attachmentStore.getAttachmentStream(tiddlerInfo.attachment_blob),
{tiddler_id: tiddlerInfo.tiddler_id});
{
tiddler_id: tiddlerInfo.tiddler_id
}
);
} else {
const { Readable } = require('stream');
const stream = new Readable();
@@ -266,6 +269,7 @@ SqlTiddlerStore.prototype.getBagTiddlerStream = function(title,bag_name) {
};
return {
tiddler_id: tiddlerInfo.tiddler_id,
bag_name: bag_name,
stream: stream,
type: tiddlerInfo.tiddler.type || "text/plain"
}