SBCAT 2026 - Scripture Burrito import#217
Open
ratatozk wants to merge 46 commits intosillsdev:developfrom
Open
SBCAT 2026 - Scripture Burrito import#217ratatozk wants to merge 46 commits intosillsdev:developfrom
ratatozk wants to merge 46 commits intosillsdev:developfrom
Conversation
The tree uses stuff from mui/x-tree-view. All other changes are to shortcut to get to FilterContent.tsx
also made it so all decendents toggle status is determined by changing it's parent's toggle status
Should have data that is returned without breaking anything
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LightSys Code-a-thon APM 2026 — Project Summary
What the Project Was About
This project added support in Audio Project Manager (APM) for reading Scripture Burrito wrappers and converting them into PTF (Project Transfer Format) files.
The system:
.zip)The converter assumes the Burrito was exported from APM. It is not designed to be a universal Burrito-to-PTF solution.
General Notes
Overall Results
Testing revealed apparent errors in the provided Scripture Burritos, preventing full validation of the upload process.
Future Work
Potential improvements include:
src/renderer/src/utils/parseBurritoMetadata.tsOverview
This module reads a Scripture Burrito wrapper directory and builds a simplified structure used by the application. It extracts:
All file reads are performed through IPC.
Data Structures
WrapperStructureRepresents the overall wrapper.
BookStructureRepresents a single book inside the wrapper.
RUT)The
chaptersandburritosfields exist to support future fine-grained filtering. Supporting that level of filtering would require deeper audio analysis and generation/editing ofapmdata, which is outside the scope of this implementation.Public Functions
readJson<T>(filePath: string): Promise<T>Reads a JSON file via IPC and parses it into a typed object.
Parameters
filePath— Absolute path to a JSON fileReturns
Promise<T>— Parsed JSON object typed asTextractLabel(labels: LocalizedString, lang: string): stringResolves a localized label from a language-to-string mapping.
Behavior:
"Burrito Wrapper"if presentParameters
labels— Object mapping language codes to stringslang— Preferred language code (e.g.,"en")Returns
string— Cleaned localized labelbuildStructure(burritoWrapperPath: string, lang: string): Promise<WrapperStructure>Reads wrapper metadata and audio Burrito metadata to construct a simplified structure.
Parameters
burritoWrapperPath— Absolute path to the wrapper directory containingmetadata.jsonlang— Preferred language code for resolving labelsReturns
Promise<WrapperStructure>— Object containing the localized wrapper label and an array of discovered bookssrc/renderer/src/utils/burritoConversion.tsOverview
This module converts a Scripture Burrito wrapper directory into one or more PTF files.
For each selected book:
.ptfarchiveAll filesystem operations are performed through IPC.
Public Functions
convertWrapperToPTFs(filter: WrapperStructure, dirPath: string): Promise<string[]>Converts selected books from a Burrito wrapper directory into individual PTF files.
apmdata)apmdatadirectoryParameters
filter— Structure describing which books should be converteddirPath— Absolute path to the Burrito wrapper directoryReturns
Promise<string[]>— Array of generated.ptffile pathsconvertBookToPTF(bookName: string, mediaList: PathObject[], dataList: PathObject[]): Promise<string>Creates a single PTF file for a given book.
Process:
.ptfarchiveParameters
bookName— Standardized book identifier (e.g.,"08RUT")mediaList— Parsed file paths for media filesdataList— Parsed file paths for APM data filesReturns
Promise<string>— File path of the generated.ptfarchiveResulting PTF Structure
Each generated archive contains:
One archive is produced per selected book.
src/renderer/src/components/FilterContent.tsxOverview
This component renders a dialog page allowing users to select which books to convert from an uploaded Scripture Burrito.
buildStructurefromparseBurritoMetadata.tsFiltering Functionality
Accepts any data formatted as
WrapperStructure(except whenbooksis empty)Supports filtering by:
Returns filtered data in the same
WrapperStructureformatNote: Backend conversion currently only supports book-level filtering.
UI/UX Images
Additions to
src/main/ipcMethods.tsThese handlers extend the Electron main process to support zipping and file/directory selection dialogs.
zipFolder(sourceDir, outFile)Creates a zip archive from a directory.
sourceDiroutFileParameters
sourceDir— Absolute path to directory to be zippedoutFile— Absolute output file path (including filename)Returns
void— Writes archive to diskopenDirectoryDialog()Opens a system dialog restricted to directory selection.
Returns
string[] | undefinedundefinedif canceledimportOpen(filters)Opens a system file selection dialog with configurable file type filters.
Modified to support importing file types beyond
.ptf.Parameters
filters— Array of Electron file filter objects (e.g., by extension)Returns
string[] | undefinedundefinedif canceled