2026-08-03 10:54:41 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "settings.h"
|
|
|
|
|
|
|
|
|
|
class ImmichClient;
|
|
|
|
|
|
|
|
|
|
class PhotoQueue {
|
|
|
|
|
public:
|
|
|
|
|
void begin(ImmichClient& client, SettingsManager& settings);
|
|
|
|
|
bool sync();
|
|
|
|
|
String next();
|
|
|
|
|
String random();
|
|
|
|
|
String current();
|
|
|
|
|
size_t size();
|
|
|
|
|
bool needsResync();
|
feat: blurred letterbox, portrait pairs, overlay metadata, button fixes
- Letterbox: extend edge pixels outward with blur + fade to solid color
- Portrait: detect and pair portraits side-by-side, fallback to solo
- Metadata: add overlay mode (corner badge), time field, custom date/time
format strings (strftime), font size 1.5x, region-aware for pairs
- Buttons: swap G9/G10 to match physical layout, double-press random
button for deep sleep, SLP indicator drawn before sleep
- Boot: remove redundant 'Loading photos' screen (saves 17s refresh)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 15:53:06 -04:00
|
|
|
String findNextPortrait();
|
2026-08-03 10:54:41 -04:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
ImmichClient* _client = nullptr;
|
|
|
|
|
SettingsManager* _settings = nullptr;
|
|
|
|
|
|
|
|
|
|
std::vector<String> _queue;
|
2026-08-03 14:39:55 -04:00
|
|
|
std::vector<String> _shown; // Recently shown IDs for dedup on refill
|
2026-08-03 10:54:41 -04:00
|
|
|
size_t _cursor = 0;
|
|
|
|
|
unsigned long _lastSyncTime = 0;
|
2026-08-03 14:39:55 -04:00
|
|
|
unsigned long _lastSyncAttempt = 0;
|
|
|
|
|
unsigned long _syncRetryDelay = 10000;
|
|
|
|
|
|
|
|
|
|
static constexpr unsigned long SYNC_RETRY_MIN = 10000; // 10 seconds
|
|
|
|
|
static constexpr unsigned long SYNC_RETRY_MAX = 300000; // 5 minutes
|
|
|
|
|
static constexpr size_t TARGET_QUEUE_SIZE = 50;
|
|
|
|
|
static constexpr int MAX_FETCH_ROUNDS = 5;
|
|
|
|
|
static constexpr size_t MAX_SHOWN_HISTORY = 200;
|
2026-08-03 10:54:41 -04:00
|
|
|
|
|
|
|
|
void shuffle();
|
|
|
|
|
void sortChronological(bool reverse);
|
|
|
|
|
void applyFavoritesWeighting();
|
|
|
|
|
std::vector<String> getSelectedAlbumIds();
|
|
|
|
|
};
|