Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
film_repository.c File Reference
+ Include dependency graph for film_repository.c:

Go to the source code of this file.

Functions

int32_t dt_film_repository_find_by_folder (const char *folder)
 
char * dt_film_repository_get_folder (const int32_t id)
 
gboolean dt_film_repository_insert (const char *folder)
 
gboolean dt_film_repository_touch_access (const int32_t id)
 
gboolean dt_film_repository_set_folder (const int32_t id, const char *folder)
 
gboolean dt_film_repository_delete (const int32_t id)
 
gboolean dt_film_repository_has_images (const int32_t id)
 
GListdt_film_repository_get_image_ids (const int32_t filmid)
 
void dt_film_repository_foreach (dt_film_repository_row_cb cb, void *user_data)
 
void dt_film_repository_foreach_empty (dt_film_repository_row_cb cb, void *user_data)
 
void dt_film_repository_foreach_under (const char *path, dt_film_repository_row_cb cb, void *user_data)
 
void dt_film_repository_folder_status_clear (void)
 
void dt_film_repository_folder_status_set (const int32_t id, const gboolean present)
 

Function Documentation

◆ dt_film_repository_delete()

gboolean dt_film_repository_delete ( const int32_t  id)

delete roll id.

Foreign keys cascade this to every image of the roll and to everything referencing those images, so the caller must have released them from its caches first.

Definition at line 112 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.

Referenced by dt_film_remove(), and dt_film_remove_empty().

◆ dt_film_repository_find_by_folder()

int32_t dt_film_repository_find_by_folder ( const char *  folder)

main.film_rolls – one row per imported folder – and the memory.film_folder scratch table that records, for this session, which of those folders still exist on disk.

Deciding what to do about a film roll is common/film.c's: whether an empty one should have its directory removed, whether the user is asked first, what a relocation means. This module answers only what the table says and writes back what it is told. the id of the roll whose folder is folder, or -1.

Matched case-insensitively on Windows and exactly everywhere else, which is why the caller cannot express this as a plain equality itself.

Definition at line 29 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.

Referenced by dt_film_get_id(), and testdb_make_film().

◆ dt_film_repository_folder_status_clear()

void dt_film_repository_folder_status_clear ( void  )

forget every recorded status

Definition at line 203 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, and L.

Referenced by dt_film_set_folder_status().

◆ dt_film_repository_folder_status_set()

void dt_film_repository_folder_status_set ( const int32_t  id,
const gboolean  present 
)

record whether roll id's folder is currently present

Definition at line 213 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.

Referenced by _record_folder_status(), and dt_film_new().

◆ dt_film_repository_foreach()

void dt_film_repository_foreach ( dt_film_repository_row_cb  cb,
void user_data 
)

every roll, in row order

Definition at line 156 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.

Referenced by dt_film_set_folder_status().

◆ dt_film_repository_foreach_empty()

void dt_film_repository_foreach_empty ( dt_film_repository_row_cb  cb,
void user_data 
)

every roll that has no images left

Definition at line 169 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.

Referenced by dt_film_remove_empty().

◆ dt_film_repository_foreach_under()

void dt_film_repository_foreach_under ( const char *  path,
dt_film_repository_row_cb  cb,
void user_data 
)

every roll whose folder is path or below it

Definition at line 186 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, IS_NULL_PTR, and L.

Referenced by dt_film_relocate().

◆ dt_film_repository_get_folder()

char * dt_film_repository_get_folder ( const int32_t  id)

◆ dt_film_repository_get_image_ids()

GList * dt_film_repository_get_image_ids ( const int32_t  filmid)

◆ dt_film_repository_has_images()

gboolean dt_film_repository_has_images ( const int32_t  id)

TRUE when roll id has at least one image

Definition at line 126 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, L, and TRUE.

Referenced by dt_film_is_empty().

◆ dt_film_repository_insert()

gboolean dt_film_repository_insert ( const char *  folder)

insert a roll for folder, stamped as accessed now

Definition at line 65 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_TEXT, DT_DEBUG_SQLITE3_PREPARE_V2, FALSE, IS_NULL_PTR, and L.

Referenced by dt_film_new(), and testdb_make_film().

◆ dt_film_repository_set_folder()

gboolean dt_film_repository_set_folder ( const int32_t  id,
const char *  folder 
)

◆ dt_film_repository_touch_access()

gboolean dt_film_repository_touch_access ( const int32_t  id)

stamp roll id as accessed now

Definition at line 82 of file film_repository.c.

References dt_database_get_sqlite3_global(), DT_DEBUG_SQLITE3_BIND_INT, DT_DEBUG_SQLITE3_PREPARE_V2, and L.

Referenced by dt_film_open().