Skip to content

Commit

Permalink
Finish cleaning up ajson logic outside of adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Joseph Petro committed Dec 19, 2024
1 parent 447ca1c commit 7cbabcd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
1 change: 0 additions & 1 deletion smart-blocks/smart_block.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,6 @@ export class SmartBlock extends SmartEntity {
get is_canvas() { return this.source.is_canvas; }
get is_excalidraw() { return this.source.is_excalidraw; }
get mtime() { return this.source.mtime; }
get multi_ajson_file_name() { return this.source.multi_ajson_file_name; }
get smart_change_adapter() { return this.source.smart_change_adapter; }

// COMPONENTS
Expand Down
8 changes: 0 additions & 8 deletions smart-collections/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,6 @@ export class CollectionItem {
return this.collection.data_adapter;
}

/**
* Generates a filename-friendly version of the item's key for storage.
* @returns {string}
*/
get multi_ajson_file_name() {
return this.key.replace(/[\s\/\.]/g, '_').replace(".md", "");
}

/**
* @returns {Object} The filesystem adapter.
*/
Expand Down
35 changes: 0 additions & 35 deletions smart-sources/smart_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,27 +328,6 @@ export class SmartSource extends SmartEntity {
}
}

// /**
// * Saves the SmartSource and its blocks by processing the save queue.
// * @async
// * @returns {Promise<void>}
// */
// async save() {
// if(this.deleted) return await super.save(super.ajson);
// const blocks_to_save = this.blocks.filter(block => block._queue_save);
// const ajson = [
// super.ajson,
// ...blocks_to_save.map(block => block.ajson).filter(ajson => ajson),
// ].join("\n");
// await super.save(ajson);
// blocks_to_save.forEach(block => {
// block._queue_save = false;
// if(block.deleted && this.block_collection.items[block.key]){
// this.block_collection.delete_item(block.key);
// }
// });
// }

/**
* Handles errors during the load process.
* @param {Error} err - The error encountered during load.
Expand Down Expand Up @@ -389,13 +368,6 @@ export class SmartSource extends SmartEntity {
return [];
}

/**
* Retrieves the data path for the SmartSource.
* @readonly
* @returns {string} The data path.
*/
get data_path() { return this.collection.data_dir + "/" + this.multi_ajson_file_name + '.ajson'; }

/**
* Retrieves the embed input, either from cache or by generating it.
* @readonly
Expand Down Expand Up @@ -528,13 +500,6 @@ export class SmartSource extends SmartEntity {
*/
get last_read() { return this.data.last_read; }

/**
* Retrieves the multi AJSON file name derived from the path.
* @readonly
* @returns {string} The multi AJSON file name.
*/
get multi_ajson_file_name() { return (this.path.split("#").shift()).replace(/[\s\/\.]/g, '_').replace(".md", ""); }

/**
* Retrieves the display name of the SmartSource.
* @readonly
Expand Down

0 comments on commit 7cbabcd

Please sign in to comment.