File indexing completed on 2025-01-05 04:29:54
0001 /** 0002 * SPDX-FileCopyrightText: 2021 Bart De Vries <bart@mogwai.be> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #pragma once 0008 0009 #include <QMetaType> 0010 #include <QQmlEngine> 0011 #include <QString> 0012 0013 namespace SyncUtils 0014 { 0015 Q_NAMESPACE 0016 QML_ELEMENT 0017 0018 // constants 0019 const QString subscriptionTimestampLabel = QStringLiteral("syncsubscriptions"); 0020 const QString episodeTimestampLabel = QStringLiteral("syncepisodes"); 0021 const QString uploadSubscriptionTimestampLabel = QStringLiteral("uploadsyncsubscriptions"); 0022 const QString uploadEpisodeTimestampLabel = QStringLiteral("uploadsyncepisodes"); 0023 const int maxAmountEpisodeUploads = 30; 0024 0025 // enums 0026 enum Provider { 0027 GPodderNet = 0, 0028 GPodderNextcloud, 0029 }; 0030 Q_ENUM_NS(Provider) 0031 0032 enum SyncStatus { 0033 NoSync = 0, 0034 RegularSync, 0035 ForceSync, 0036 UploadOnlySync, 0037 PushAllSync, 0038 }; 0039 0040 Q_ENUM_NS(SyncStatus) 0041 0042 // structs 0043 struct EpisodeAction { 0044 QString podcast; 0045 QString url; 0046 QString id; 0047 QString device; 0048 QString action; 0049 qulonglong started; 0050 qulonglong position; 0051 qulonglong total; 0052 qulonglong timestamp; 0053 }; 0054 0055 struct Device { 0056 Q_GADGET 0057 public: 0058 QString id; 0059 QString caption; 0060 QString type; 0061 int subscriptions; 0062 Q_PROPERTY(QString caption MEMBER caption) 0063 Q_PROPERTY(QString id MEMBER id) 0064 Q_PROPERTY(QString type MEMBER type) 0065 Q_PROPERTY(int subscriptions MEMBER subscriptions) 0066 }; 0067 }