feat: photo queue manager with cycling modes and favorites weighting

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 10:54:41 -04:00
parent 8f85015339
commit 9166bfe0ce
3 changed files with 316 additions and 0 deletions

32
src/photo_queue.h Normal file
View File

@@ -0,0 +1,32 @@
#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();
String findPortraitPair(size_t startIndex);
private:
ImmichClient* _client = nullptr;
SettingsManager* _settings = nullptr;
std::vector<String> _queue;
size_t _cursor = 0;
unsigned long _lastSyncTime = 0;
void shuffle();
void sortChronological(bool reverse);
void applyFavoritesWeighting();
std::vector<String> getSelectedAlbumIds();
};