From 89e19687d0307b913ea80a83635d8ff7cc00f85e Mon Sep 17 00:00:00 2001 From: Rhet Turnbull Date: Thu, 18 Feb 2021 08:30:13 -0800 Subject: [PATCH] Updated Structure of the code (markdown) --- Structure-of-the-code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Structure-of-the-code.md b/Structure-of-the-code.md index ed40336..002d862 100644 --- a/Structure-of-the-code.md +++ b/Structure-of-the-code.md @@ -42,7 +42,7 @@ Broadly, osxphotos works like this: 2. Reads `photos.db` to determine which version of Photos created the library (`PhotosDB._get_db_version()`) 3. If library created with Photos version 2, 3, or 4, `PhotosDB._process_database4()` processes the database file to extract all required information. 4. If library created with Photos 5, the actual database is `Photos.sqlite` so this is opened readonly or copied to a temporary file if locked, then `PhotosDB._process_database5()` is called to process the database file and extra all required information. -5. `_process_database4` and `_process_database5` execute several SQL queries to extract the required data. These methods populate a series of data structures in `PhotosDB` which are then used by the rest of code to create the `PhotoInfo`, `AlbumInfo`, and `FolderInfo` objects. These database structures are ugly...in general, they flatten the SQL database into several different python dicts. The "master" dict is called `_dbphotos`. The key is the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) of the photo and the value is another dict containing details about the photo. Read the code for `PhotosDB.__init__()` for additional details. Each of the data structures is documented in the code. +5. `_process_database4` and `_process_database5` execute several SQL queries to extract the required data. These methods populate a series of data structures in `PhotosDB` which are then used by the rest of code to create the `PhotoInfo`, `AlbumInfo`, and `FolderInfo` objects. These database structures are ugly...in general, they flatten the SQL database into several different python dicts. The "main" dict is called `_dbphotos`. The key is the [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) of the photo and the value is another dict containing details about the photo. Read the code for `PhotosDB.__init__()` for additional details. Each of the data structures is documented in the code. 6. The `PhotoInfo`, `AlbumInfo`, and `FolderInfo` objects are created as needed. For example, `PhotosDB.photos()` returns a list of `PhotoInfo` objects representing the photos in the database and `PhotoInfo.album_info` returns a list of `AlbumInfo` objects representing the albums the photo is contained in.