v0.5.0: manifests, filters, logging, docs
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
#include <string.h>
|
||||
#include "../bridge/photokit_bridge.h"
|
||||
|
||||
static export_progress_t stub_progress_slots[3];
|
||||
static export_progress_t stub_progress_slots[16];
|
||||
static int stub_progress_slot_count = 16;
|
||||
static int stub_progress_slots_null = 0;
|
||||
|
||||
static char *alloc_json(const char *s) {
|
||||
size_t len = strlen(s);
|
||||
@@ -49,10 +51,11 @@ char *photos_list_assets_json(const char *album_id) {
|
||||
return alloc_json(stub_assets_json);
|
||||
}
|
||||
|
||||
char *photos_export_preview_json(const char *asset_id, const char *output_dir, int target_size, int index, int slot_index) {
|
||||
char *photos_export_preview_json(const char *asset_id, const char *output_dir, int target_size, int quality, int index, int slot_index) {
|
||||
(void)asset_id;
|
||||
(void)output_dir;
|
||||
(void)target_size;
|
||||
(void)quality;
|
||||
(void)index;
|
||||
(void)slot_index;
|
||||
return maybe_alloc_json(stub_export_preview_json);
|
||||
@@ -87,18 +90,43 @@ void photos_test_set_export_preview_json(const char *json) {
|
||||
stub_export_preview_json = json;
|
||||
}
|
||||
|
||||
void photos_test_set_export_preview_json_null(void) {
|
||||
stub_export_preview_json = NULL;
|
||||
}
|
||||
|
||||
void photos_test_set_export_original_json(const char *json) {
|
||||
stub_export_original_json = json;
|
||||
}
|
||||
|
||||
void photos_test_set_export_original_json_null(void) {
|
||||
stub_export_original_json = NULL;
|
||||
}
|
||||
|
||||
export_progress_t *photos_get_progress_slots(void) {
|
||||
if (stub_progress_slots_null) return NULL;
|
||||
return stub_progress_slots;
|
||||
}
|
||||
|
||||
export_progress_t photos_get_progress_slot(export_progress_t *slots, int index) {
|
||||
export_progress_t result = {0, 0.0, 0, 0};
|
||||
if (index >= 0 && index < 16) {
|
||||
result = slots[index];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int photos_get_progress_slot_count(void) {
|
||||
return 3;
|
||||
return stub_progress_slot_count;
|
||||
}
|
||||
|
||||
void photos_reset_progress_slots(void) {
|
||||
memset(stub_progress_slots, 0, sizeof(stub_progress_slots));
|
||||
}
|
||||
}
|
||||
|
||||
void photos_test_set_progress_slot_count(int count) {
|
||||
stub_progress_slot_count = count;
|
||||
}
|
||||
|
||||
void photos_test_set_progress_slots_null(int val) {
|
||||
stub_progress_slots_null = val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user