Compare commits

..

33 Commits

Author SHA1 Message Date
Alex Tran
9c01ca1080 Added correct page title for admin sub pages 2022-12-10 09:23:02 -06:00
Alex Tran
09103dc981 Fixed upsert new DeviceInfo with null isAutoBackup property 2022-12-10 08:36:21 -06:00
Alex Tran
f096910abc Fix release note 2022-12-09 21:54:58 -06:00
Jason Rasmussen
242165485d fix(server): unique email database constraint (#1082) 2022-12-09 21:16:25 -06:00
Alex Tran
e6904ca884 api spec sync 2022-12-09 21:15:53 -06:00
Jason Rasmussen
5a792cc821 chore(docs): spelling (#1081) 2022-12-09 18:39:50 -05:00
Alex
0633eaf68c Pump 2022-12-09 15:19:22 -06:00
Jason Rasmussen
40afa3695a docs: server commands (#1079) 2022-12-09 14:54:19 -06:00
Jason Rasmussen
14889e7d85 fix(server): require local admin account (#1070) 2022-12-09 14:53:11 -06:00
Jason Rasmussen
3bb103c6b6 fix(server): link 'immich' (#1080) 2022-12-09 14:52:56 -06:00
Jason Rasmussen
5e680551b9 feat(server,web): migrate oauth settings from env to system config (#1061) 2022-12-09 14:51:42 -06:00
Jason Rasmussen
cefdd86b7f refactor(server): device info service (#1071)
* refactor(server): device info service

* use upsertDeviceInfo in mobile app

* fix: return types and dedupe code

Co-authored-by: Fynn Petersen-Frey <zoodyy@users.noreply.github.com>
2022-12-08 09:57:07 -06:00
Matt
b8e26a2112 unraid guide no longer external (#1074)
Co-authored-by: Matt Farrell <mfarrell@squareup.com>
2022-12-08 09:54:06 -06:00
Jason Rasmussen
58a149990d refactor(server): server version logging (#1073)
* refactor(server): server version logging

* chore: server => microservices
2022-12-08 09:53:18 -06:00
Fynn Petersen-Frey
c23b2479f7 feat(mobile): configurable background backup delay (#1068)
let's the user configure how much to delay the trigger for running the backup whenever assets are changed on the device
2022-12-08 09:51:36 -06:00
bo0tzz
a97b761eda Add generated openapi docs to website (#1067)
* Add generated openapi docs to website

* Uppercase API link in navbar

* fix(docs): open api empty summary (#1069)

* feat(docs): Use /docs/api path for swagger docs

* Sync api version to be the same as the server

* Update version

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2022-12-07 21:57:34 -06:00
Alex
1adf8ff6b6 chore(web) Update SvelteKit (#1066)
* Update sveltekit

* Update sveltekit

* Update correct preloading attribute
2022-12-06 18:08:08 -06:00
Alex Tran
b5a5363a6a Fixed openapi generation command for mobile 2022-12-06 16:10:04 -06:00
Alex
f91bdc2785 fix(server) added TagResponseDto for TagController (#1065)
* fix(server) added TagResponseDto for TagController

* Added userId to DTO
2022-12-06 15:46:13 -06:00
Alex
db34f2f7fd fix(server) fix correct MIME type for Nikon NEF (#1060) 2022-12-05 12:05:02 -06:00
Alex
5de8ea162d feat(server) Tagging system (#1046) 2022-12-05 11:56:44 -06:00
Alex
6e2763b72c Fix plural 2022-12-05 10:52:21 -06:00
Alex
966d99217a fix(web) fix test (#1059) 2022-12-04 22:51:22 -06:00
Alex
5d140145c1 Update README.md 2022-12-04 17:15:41 -06:00
Alex
fcf3b0b672 Update README_zh_CN.md
Add information about community maintained readme
2022-12-04 17:15:14 -06:00
Matthias Rupp
e8bbad6772 feat(server): Per user asset access control (#993)
* Limit asset access to owner

* Check public albums for asset

* Clean up

* Fix test

* Rename repository method

* Simplify control flow

* Revert "Simplify control flow"

This reverts commit 7bc3cbf687.

* Revert Makefile change
2022-12-04 11:42:36 -06:00
Kiel Hurley
5f2b75997f feat(web): Localize dates and numbers (#1056) 2022-12-04 09:35:20 -06:00
chen3stones
426ce77f1c chore(): add Chinese README file (#1058)
Co-authored-by: chen3stones <chen3stones@outlook.com>
2022-12-03 22:03:29 -06:00
Fynn Petersen-Frey
83c7434eb5 feat(mobile): enable zoom of preview images & reuse cached thumbnails (#1049) 2022-12-03 21:59:39 -06:00
Jason Rasmussen
99854e90be feat(server): link via profile.sub (#1055) 2022-12-03 21:59:24 -06:00
Fynn Petersen-Frey
424b11cf50 feat(mobile): configure detail viewer asset loading (#1044) 2022-12-02 14:55:10 -06:00
Alex Tran
da87b1256c Release mobile hotfix 2022-12-01 23:16:22 -06:00
Alex
a3971543b5 fix(mobile): Start up from splash screen does not trigger foreground backup (#1042) 2022-12-01 09:20:53 -06:00
278 changed files with 15398 additions and 7025 deletions

13
.gitattributes vendored Normal file
View File

@@ -0,0 +1,13 @@
mobile/openapi/**/*.md -diff -merge
mobile/openapi/**/*.md linguist-generated=true
mobile/openapi/**/*.dart -diff -merge
mobile/openapi/**/*.dart linguist-generated=true
web/src/api/open-api/**/*.md -diff -merge
web/src/api/open-api/**/*.md linguist-generated=true
web/src/api/open-api/**/*.ts -diff -merge
web/src/api/open-api/**/*.ts linguist-generated=true
mobile/openapi/.openapi-generator/FILES -diff -merge
mobile/openapi/.openapi-generator/FILES linguist-generated=true

View File

@@ -4,6 +4,9 @@ dev:
dev-new:
rm -rf ./server/dist && docker compose -f ./docker/docker-compose.dev.yml up --remove-orphans
dev-new-update:
rm -rf ./server/dist && docker compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans
dev-update:
rm -rf ./server/dist && docker-compose -f ./docker/docker-compose.dev.yml up --build -V --remove-orphans
@@ -26,4 +29,7 @@ prod-scale:
docker-compose -f ./docker/docker-compose.yml up --build -V --scale immich-server=3 --scale immich-microservices=3 --remove-orphans
api:
cd ./server && npm run api:generate
cd ./server && npm run api:generate
attach-server:
docker exec -it docker_immich-server_1 sh

View File

@@ -1,9 +0,0 @@
# TODO
Server scenario with web
[ ] 1 user exist without admin right -> make admin on first check
[ ] 2 users exist without admin right -> ask user to choose which account will be the admin
[ X ] No users exist -> prompt signup form for Admin

View File

@@ -17,6 +17,9 @@
<img src="design/immich-screenshots.png" title="Main Screenshot">
</a>
<br/>
<p align="center">
<a href="README_zh_CN.md">中文</a>
</p>
## Disclaimer

115
README_zh_CN.md Normal file
View File

@@ -0,0 +1,115 @@
<p align="center">
<br/>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green.svg?color=3F51B5&style=for-the-badge&label=License&logoColor=000000&labelColor=ececec" alt="License: MIT"></a>
<a href="https://discord.gg/D8JsnBEuKb">
<img src="https://img.shields.io/discord/979116623879368755.svg?label=Discord&logo=Discord&style=for-the-badge&logoColor=000000&labelColor=ececec" atl="Discord"/>
</a>
<br/>
<br/>
</p>
<p align="center">
<img src="design/immich-logo.svg" width="150" title="Login With Custom URL">
</p>
<h3 align="center">Immich - 高性能的自托管照片和视频备份方案</h3>
<p align="center">
请注意: 此README不是由Immich团队维护, 这意味着它在某一时间点不会被更新,因为我们是依靠贡献者来更新的。感谢理解。
</p>
<br/>
<a href="https://immich.app">
<img src="design/immich-screenshots.png" title="Main Screenshot">
</a>
<br/>
<p align="center">
<a href="README.md">English</a>
</p>
## 免责声明
- ⚠️ 本项目正在 **非常活跃** 的开发中。
- ⚠️ 可能存在bug或者重大变更。
- ⚠️ **不要把本软件作为你存储照片或视频的唯一方式!**
## 目录
- [官方文档](https://immich.app/docs/overview/introduction)
- [示例](#示例)
- [功能特性](#功能特性)
- [介绍](https://immich.app/docs/overview/introduction)
- [安装](https://immich.app/docs/installation/requirements)
- [贡献指南](https://immich.app/docs/contribution-guidelines)
- [支持本项目](#support-the-project)
- [已知问题](#known-issues)
## 官方文档
你可以在 https://immich.app/ 找到包含安装手册的官方文档.
## 示例
你可以在 https://demo.immich.app 访问示例.
在移动端, 你可以使用 `https://demo.immich.app/api`获取`服务终端链接`
```bash title="示例认证信息"
认证信息
邮箱: demo@immich.app
密码: demo
```
```
规格: 甲骨文免费虚拟机套餐-阿姆斯特丹 4核 2.4Ghz ARM64 CPU, 24GB RAM。
```
# 功能特性
| 功能特性 | 移动端 | 网页端 |
| ------------------------------------------- | ------- | --- |
| 上传并查看照片和视频 | 是 | 是 |
| 软件运行时自动备份 | 是 | N/A |
| 选择需要备份的相册 | 是 | N/A |
| 下载照片和视频到本地 | 是 | 是 |
| 多用户支持 | 是 | 是 |
| 相册 | 是 | 是 |
| 共享相册 | 是 | 是 |
| 可拖动的快速导航栏 | 是 | 是 |
| 支持RAW格式 (HEIC, HEIF, DNG, Apple ProRaw) | 是 | 是 |
| 元数据视图 (EXIF, 地图) | 是 | 是 |
| 通过元数据、对象和标签进行搜索 | 是 | No |
| 管理功能 (用户管理) | N/A | 是 |
| 后台备份 | Android | N/A |
| 虚拟滚动 | 是 | 是 |
| OAuth支持 | 是 | 是 |
| 实时照片备份和查看 (仅iOS) | 是 | 是 |
# 支持本项目
我已经致力于本项目并且将我会持续更新文档、新增功能和修复问题。但是我不能一个人走下去,所以我需要你给予我走下去的动力。
就像我主页里面 [selfhosted.show - In the episode 'The-organization-must-not-be-name is a Hostile Actor'](https://selfhosted.show/79?t=1418) 说的一样,这是我和团队的一项艰巨的任务。我希望某一天我能够全职开发本项目,在此我希望你们能够助我梦想成真。
如果你使用了本项目一段时间,并且觉得上面的话有道理,那么请你按照如下方式帮助我吧。
## 捐赠
- [按月捐赠](https://github.com/sponsors/alextran1502) via GitHub Sponsors
- [一次捐赠](https://github.com/sponsors/alextran1502?frequency=one-time&sponsor=alextran1502) via Github Sponsors
# 已知问题
## TensorFlow 构建问题
_这是一个针对于Proxmox的已知问题_
TensorFlow 不能运行在很旧的CPU架构上, 需要运行在AVX和AVX2指令集的CPU上。如果你在docker-compose的命令行中遇到了 `illegal instruction core dump`的错误, 通过如下命令检查你的CPU flag寄存器然后确保你能够看到`AVX`和`AVX2`的字样:
```bash
more /proc/cpuinfo | grep flags
```
如果你在Proxmox中运行虚拟机, 虚拟机中没有启用flag寄存器。
你需要在虚拟机的硬件面板中把CPU类型从`kvm64`改为`host`。
`Hardware > Processors > Edit > Advanced > Type (dropdown menu) > host`

View File

@@ -13,7 +13,13 @@ sidebar_position: 6
| ![cloud-done](/img/cloud-done.svg) | Asset was uploaded from this device and is now backed up in the cloud/server and still available in original on the device |
### How can I sync an existing directory with Immich's server?
Immich doesn't have the mechanism to sync an existing directory with the server. There is however, a helper CLI tool to help you bulk upload the existing photos and videos to the server. You can find the guide to use the CLI tool [here](/docs/usage/bulk-upload.md).
### Why doesn't Immich watch an existing photo gallery directory?
The initial approach of Immich is to become a backup tool, primarily for mobile device usage. Thus, all the assets must be uploaded from the mobile client. The app was architectured to perform that job well.
The initial approach of Immich is to become a backup tool, primarily for mobile device usage. Thus, all the assets must be uploaded from the mobile client. The app was architectured to perform that job well.
### How can I reset the admin password?
The admin password can be reset by running the [reset-admin-password](/docs/usage/server-commands) command on the immich-server.

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 910 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -4,12 +4,104 @@ sidebar_position: 5
# Unraid
Install Immich on Unraid.
Install Immich on Unraid using the [Docker Compose Manager](https://forums.unraid.net/topic/114415-plugin-docker-compose-manager/) plugin from the Unraid Community Apps.
:::info
- Guide was written using Unraid v6.11.1
- Requires you to have installed the plugin: [Docker Compose Manager](https://forums.unraid.net/topic/114415-plugin-docker-compose-manager/)
- An Unraid share created for your images
- There has been a [report](https://forums.unraid.net/topic/130006-errortraps-traps-node27707-trap-invalid-opcode-ip14fcfc8d03c0-sp7fff32889dd8-more/#comment-1189395) of this not working if your Unraid server doesn't support AVX _(e.g. using a T610)_
:::info Community contribution
Please follow [this community contributed article](https://mfaz.dev/posts/immich-unraid/) to install Immich on Unraid.
:::
1. Go to "**Plugins**" and click on "**Compose.Manager**"
2. Click "**Add New Stack**" and when prompted for a label enter "**Immich**"
<img
src={require('./img/unraid01.webp').default}
width="70%"
alt="Select Plugins > Compose.Manager > Add New Stack > Label it Immich"
/>
3. Select the cog ⚙️ next to Immich then click "**Edit Stack**"
4. Click "**Compose File**" and then paste the entire contents of the [Immich Docker Compose](https://raw.githubusercontent.com/immich-app/immich/main/docker/docker-compose.yml) file into the Unraid editor
<details >
<summary>Using an existing Postgres container? Click me! Otherwise proceed to step 5.</summary>
<ul>
<li>Comment out the database service</li>
<img
src={require('./img/unraid02.png').default}
width="50%"
alt="Comment out database service in the compose file"
/>
<li>Comment out the database dependency for <b>each service</b> <i>(example in screenshot below only shows 2 of the services - ensure you do this for all services)</i></li>
<img
src={require('./img/unraid03.png').default}
width="50%"
alt="Comment out every reference to the database service in the compose file"
/>
<li>Comment out the volumes</li>
<img
src={require('./img/unraid04.png').default}
width="20%"
alt="Comment out database volume"
/>
</ul>
</details>
5. Click "**Save Changes**", you will be promoted to edit stack UI labels, just leave this blank and click "**Ok**"
6. Select the cog ⚙️ next to Immich, click "**Edit Stack**", then click "**Env File**"
7. Past the entire contents of the [Immich .env.example](https://raw.githubusercontent.com/immich-app/immich/main/docker/.env.example) file into the Unraid editor, then **before saving** edit the following:
- `JWT_SECRET`: Generate a unique secret and paste the value here > Can be generated by either typing `openssl rand -base64 128` in your terminal or copying from [uuidgenerator](https://www.uuidgenerator.net/version1)
- `UPLOAD_LOCATION`: Create a folder in your Images Unraid share and place the **absolute** location here > For example my _"images"_ share has a folder within it called _"immich"_. If I browse to this directory in the terminal and type `pwd` the output is `/mnt/user/images/immich`. This is the exact value I need to enter as my `UPLOAD_LOCATION`
<img
src={require('./img/unraid05.webp').default}
width="70%"
alt="Absolute location of where you want immich images stored"
/>
<details >
<summary>Using an existing Postgres container? Click me! Otherwise proceed to step 8.</summary>
<p>Update the following database variables as relevant to your Postgres container:</p>
<ul>
<li><code>DB_HOSTNAME</code></li>
<li><code>DB_USERNAME</code></li>
<li><code>DB_PASSWORD</code></li>
<li><code>DB_DATABASE_NAME</code></li>
<li><code>DB_PORT</code></li>
</ul>
</details>
8. Click "**Save Changes**" followed by "**Compose Up**" and Unraid will begin to create the Immich containers in a popup window. Once complete you will see a message on the popup window stating _"Connection Closed"_. Click "**Done**" and go to the Unraid "**Docker**" page
> Note: This can take several minutes depending on your Internet speed and Unraid hardware
9. Once on the Docker page you will see several Immich containers, one of them will be labelled `immich_proxy` and will have a port mapping. Visit the `IP:PORT` displayed in your web browser and you should see the Immich admin setup page.
<img
src={require('./img/unraid06.webp').default}
width="80%"
alt="Go to Docker Tab and visit the address listed next to immich-proxy"
/>
<details >
<summary>Using the Unraid Docker Folders plugin? Click me! Otherwise you're complete!</summary>
<p>If you are using the Docker Folders plugin go the Docker tab and select "<b>New Folder</b>".<br />Label it <i>"Immich"</i> and use the logo from the <a href="https://immich.app/">Immich homepage</a> <i>(right click the logo, "Save As", and reupload to Unraid)</i><br />Then simply select all the Immich related containers before clicking "<b>Submit</b>"</p>
<img
src={require('./img/unraid07.webp').default}
width="80%"
alt="Go to Docker Tab and visit the address listed next to immich-proxy"
/>
<img
src={require('./img/unraid08.webp').default}
width="90%"
alt="Go to Docker Tab and visit the address listed next to immich-proxy"
/>
</details>
:::tip
For more information on how to use the application, please refer to the [Post Installation](/docs/usage/post-installation) guide.
:::
For more information on how to use the application once installed, please refer to the [Post Installation](/docs/usage/post-installation) guide.
:::

View File

@@ -1,5 +1,5 @@
{
"label": "How to use the application",
"label": "Usage",
"position": 3,
"link": {
"type": "generated-index",

View File

@@ -28,13 +28,13 @@ Before enabling OAuth in Immich, a new client application needs to be configured
2. Configure Redirect URIs/Origins
The **Sign-in redirect URIs** should include:
The **Sign-in redirect URIs** should include:
- All URLs that will be used to access the login page of the Immich web client (eg. `http://localhost:2283/auth/login`, `http://192.168.0.200:2283/auth/login`, `https://immich.example.com/auth/login`)
- Mobile app redirect URL `app.immich:/`
* All URLs that will be used to access the login page of the Immich web client (eg. `http://localhost:2283/auth/login`, `http://192.168.0.200:2283/auth/login`, `https://immich.example.com/auth/login`)
* Mobile app redirect URL `app.immich:/`
:::caution
You **MUST** include `app.immich:/` as the redirect URI for iOS and Android mobile app to work properly.
You **MUST** include `app.immich:/` as the redirect URI for iOS and Android mobile app to work properly.
**Authentik example**
<img src={require('./img/authentik-redirect.png').default} title="Authentik Redirection URL" width="80%" />
@@ -42,17 +42,17 @@ You **MUST** include `app.immich:/` as the redirect URI for iOS and Android mobi
## Enable OAuth
Once you have a new OAuth client application configured, Immich can be configured using the following environment variables:
Once you have a new OAuth client application configured, Immich can be configured using the Administration Settings page, available on the web (Administration -> Settings).
| Key | Type | Default | Description |
| Setting | Type | Default | Description |
| ------------------- | ------- | -------------------- | ------------------------------------------------------------------------- |
| OAUTH_ENABLED | boolean | false | Enable/disable OAuth2 |
| OAUTH_ISSUER_URL | URL | (required) | Required. Self-discovery URL for client (from previous step) |
| OAUTH_CLIENT_ID | string | (required) | Required. Client ID (from previous step) |
| OAUTH_CLIENT_SECRET | string | (required) | Required. Client Secret (previous step) |
| OAUTH_SCOPE | string | openid email profile | Full list of scopes to send with the request (space delimited) |
| OAUTH_AUTO_REGISTER | boolean | true | When true, will automatically register a user the first time they sign in |
| OAUTH_BUTTON_TEXT | string | Login with OAuth | Text for the OAuth button on the web |
| OAuth enabled | boolean | false | Enable/disable OAuth2 |
| OAuth issuer URL | URL | (required) | Required. Self-discovery URL for client (from previous step) |
| OAuth client ID | string | (required) | Required. Client ID (from previous step) |
| OAuth client secret | string | (required) | Required. Client Secret (previous step) |
| OAuth scope | string | openid email profile | Full list of scopes to send with the request (space delimited) |
| OAuth button text | string | Login with OAuth | Text for the OAuth button on the web |
| OAuth auto register | boolean | true | When true, will automatically register a user the first time they sign in |
:::info
The Issuer URL should look something like the following, and return a valid json document.
@@ -63,14 +63,4 @@ The Issuer URL should look something like the following, and return a valid json
The `.well-known/openid-configuration` part of the url is optional and will be automatically added during discovery.
:::
Here is an example of a valid configuration for setting up Immich to use OAuth with Authentik:
```
OAUTH_ENABLED=true
OAUTH_ISSUER_URL=http://192.168.0.187:9000/application/o/immich
OAUTH_CLIENT_ID=f08f9c5b4f77dcfd3916b1c032336b5544a7b368
OAUTH_CLIENT_SECRET=6fe2e697644da6ff6aef73387a457d819018189086fa54b151a6067fbb884e75f7e5c90be16d3c688cf902c6974817a85eab93007d76675041eaead8c39cf5a2
OAUTH_BUTTON_TEXT=Login with Authentik
```
[oidc]: https://openid.net/connect/

View File

@@ -0,0 +1,25 @@
---
sidebar_position: 5
---
# Server Commands
The `immich-server` docker image comes preinstalled with an administrative CLI that supports the following commands:
| Command | Description |
| ----------------------------- | ------------------------------------- |
| `immich help` | Display help |
| `immich reset-admin-password` | Reset the password for the admin user |
## How to run a command
To run a command, connect to the container and then execute it. For example:
```bash
docker exec -it immich-server_1 sh
/usr/src/app$ immich reset-admin-password
? Please choose a new password (optional) immich-is-awesome-unlike-this-password
New password:
immich-is-awesome-unlike-this-password
```

View File

@@ -30,8 +30,8 @@ const config = {
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
"docusaurus-preset-openapi",
/** @type {import('docusaurus-preset-openapi').Options} */
({
docs: {
showLastUpdateAuthor: true,
@@ -42,6 +42,10 @@ const config = {
// Remove this to remove the "edit this page" links.
editUrl: "https://github.com/immich-app/immich/tree/main/docs/",
},
api: {
path: "../server/immich-openapi-specs.json",
routeBasePath: "/docs/api"
},
// blog: {
// showReadingTime: true,
// editUrl: "https://github.com/immich-app/immich/tree/main/docs/",
@@ -80,6 +84,11 @@ const config = {
position: "right",
label: "Documentation",
},
{
to: "/docs/api",
position: "right",
label: "API"
},
{ to: "/blog", label: "Blog", position: "right" },
{
href: "https://github.com/immich-app/immich",

2742
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -19,9 +19,11 @@
"@docusaurus/preset-classic": "2.1.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"docusaurus-preset-openapi": "^0.6.3",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"url": "^0.11.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.1.0",

View File

@@ -54,7 +54,9 @@ class BackgroundServicePlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
val args = call.arguments<ArrayList<*>>()!!
val requireUnmeteredNetwork = args.get(0) as Boolean
val requireCharging = args.get(1) as Boolean
ContentObserverWorker.configureWork(ctx, requireUnmeteredNetwork, requireCharging)
val triggerUpdateDelay = (args.get(2) as Number).toLong()
val triggerMaxDelay = (args.get(3) as Number).toLong()
ContentObserverWorker.configureWork(ctx, requireUnmeteredNetwork, requireCharging, triggerUpdateDelay, triggerMaxDelay)
result.success(true)
}
"disable" -> {

View File

@@ -37,6 +37,8 @@ class ContentObserverWorker(ctx: Context, params: WorkerParameters) : Worker(ctx
const val SHARED_PREF_SERVICE_ENABLED = "serviceEnabled"
const val SHARED_PREF_REQUIRE_WIFI = "requireWifi"
const val SHARED_PREF_REQUIRE_CHARGING = "requireCharging"
const val SHARED_PREF_TRIGGER_UPDATE_DELAY = "triggerUpdateDelay"
const val SHARED_PREF_TRIGGER_MAX_DELAY = "triggerMaxDelay"
private const val TASK_NAME_OBSERVER = "immich/ContentObserver"
@@ -62,12 +64,16 @@ class ContentObserverWorker(ctx: Context, params: WorkerParameters) : Worker(ctx
*/
fun configureWork(context: Context,
requireWifi: Boolean = false,
requireCharging: Boolean = false) {
requireCharging: Boolean = false,
triggerUpdateDelay: Long = 5000,
triggerMaxDelay: Long = 50000) {
context.getSharedPreferences(BackupWorker.SHARED_PREF_NAME, Context.MODE_PRIVATE)
.edit()
.putBoolean(SHARED_PREF_SERVICE_ENABLED, true)
.putBoolean(SHARED_PREF_REQUIRE_WIFI, requireWifi)
.putBoolean(SHARED_PREF_REQUIRE_CHARGING, requireCharging)
.putLong(SHARED_PREF_TRIGGER_UPDATE_DELAY, triggerUpdateDelay)
.putLong(SHARED_PREF_TRIGGER_MAX_DELAY, triggerMaxDelay)
.apply()
BackupWorker.updateBackupWorker(context, requireWifi, requireCharging)
}
@@ -106,12 +112,14 @@ class ContentObserverWorker(ctx: Context, params: WorkerParameters) : Worker(ctx
}
private fun enqueueObserverWorker(context: Context, policy: ExistingWorkPolicy) {
val sp = context.getSharedPreferences(BackupWorker.SHARED_PREF_NAME, Context.MODE_PRIVATE)
val constraints = Constraints.Builder()
.addContentUriTrigger(MediaStore.Images.Media.INTERNAL_CONTENT_URI, true)
.addContentUriTrigger(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, true)
.addContentUriTrigger(MediaStore.Video.Media.INTERNAL_CONTENT_URI, true)
.addContentUriTrigger(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, true)
.setTriggerContentUpdateDelay(5000, TimeUnit.MILLISECONDS)
.setTriggerContentUpdateDelay(sp.getLong(SHARED_PREF_TRIGGER_UPDATE_DELAY, 5000), TimeUnit.MILLISECONDS)
.setTriggerContentMaxDelay(sp.getLong(SHARED_PREF_TRIGGER_MAX_DELAY, 50000), TimeUnit.MILLISECONDS)
.build()
val work = OneTimeWorkRequest.Builder(ContentObserverWorker::class.java)

View File

@@ -35,8 +35,8 @@ platform :android do
task: 'bundle',
build_type: 'Release',
properties: {
"android.injected.version.code" => 58,
"android.injected.version.name" => "1.37.0",
"android.injected.version.code" => 60,
"android.injected.version.name" => "1.38.0",
}
)
upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab')

View File

@@ -0,0 +1 @@
* Fixed foreground backup not triggered on app relaunch

View File

@@ -0,0 +1,2 @@
* Improve data usage on loading asset
* Add background backup delay

View File

@@ -5,17 +5,17 @@
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000345">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000201">
</testcase>
<testcase classname="fastlane.lanes" name="1: bundleRelease" time="123.14891">
<testcase classname="fastlane.lanes" name="1: bundleRelease" time="63.132489">
</testcase>
<testcase classname="fastlane.lanes" name="2: upload_to_play_store" time="39.270764">
<testcase classname="fastlane.lanes" name="2: upload_to_play_store" time="38.15883">
</testcase>

View File

@@ -41,6 +41,7 @@
"backup_controller_page_background_turn_off": "Turn off background service",
"backup_controller_page_background_turn_on": "Turn on background service",
"backup_controller_page_background_wifi": "Only on WiFi",
"backup_controller_page_background_delay": "Delay new assets backup: {}",
"backup_controller_page_backup": "Backup",
"backup_controller_page_backup_selected": "Selected: ",
"backup_controller_page_backup_sub": "Backed up photos and videos",
@@ -134,6 +135,7 @@
"setting_notifications_notify_hours": "{} hours",
"setting_notifications_notify_immediately": "immediately",
"setting_notifications_notify_minutes": "{} minutes",
"setting_notifications_notify_seconds": "{} seconds",
"setting_notifications_notify_never": "never",
"setting_notifications_subtitle": "Adjust your notification preferences",
"setting_notifications_title": "Notifications",
@@ -141,6 +143,11 @@
"setting_notifications_total_progress_subtitle": "Overall upload progress (done/total assets)",
"setting_notifications_single_progress_title": "Show background backup detail progress",
"setting_notifications_single_progress_subtitle": "Detailed upload progress information per asset",
"setting_image_viewer_help": "The detail viewer loads the small thumbnail first, then loads the medium-size preview (if enabled), finally loads the original (if enabled).",
"setting_image_viewer_preview_title": "Load preview image",
"setting_image_viewer_preview_subtitle": "Enable to load a medium-resolution image. Disable to either directly load the original or only use the thumbnail.",
"setting_image_viewer_original_title": "Load original image",
"setting_image_viewer_original_subtitle": "Enable to load the original full-resolution image (large!). Disable to reduce data usage (both network and on device cache).",
"setting_pages_app_bar_settings": "Settings",
"share_add": "Add",
"share_add_photos": "Add photos",
@@ -165,8 +172,6 @@
"theme_setting_system_theme_switch": "Automatic (Follow system setting)",
"theme_setting_theme_subtitle": "Choose the app's theme setting",
"theme_setting_theme_title": "Theme",
"theme_setting_three_stage_loading_subtitle": "Three-stage loading might increase the loading performance but causes significantly higher network load",
"theme_setting_three_stage_loading_title": "Enable three-stage loading",
"version_announcement_overlay_ack": "Acknowledge",
"version_announcement_overlay_release_notes": "release notes",
"version_announcement_overlay_text_1": "Hi friend, there is a new release of",

View File

@@ -31,4 +31,4 @@ Runner/GeneratedPluginRegistrant.*
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
!default.perspectivev3

View File

@@ -360,7 +360,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 74;
DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -495,7 +495,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 74;
DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
@@ -522,7 +522,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 72;
CURRENT_PROJECT_VERSION = 74;
DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;

View File

@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.36.1</string>
<string>1.37.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>72</string>
<string>74</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>MGLMapboxMetricsEnabledSettingShownInApp</key>

View File

@@ -19,7 +19,7 @@ platform :ios do
desc "iOS Beta"
lane :beta do
increment_version_number(
version_number: "1.37.0"
version_number: "1.38.0"
)
increment_build_number(
build_number: latest_testflight_build_number + 1,

View File

@@ -5,32 +5,29 @@
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000358">
<testcase classname="fastlane.lanes" name="0: default_platform" time="0.000334">
</testcase>
<testcase classname="fastlane.lanes" name="1: increment_version_number" time="0.721922">
<testcase classname="fastlane.lanes" name="1: increment_version_number" time="1.671363">
</testcase>
<testcase classname="fastlane.lanes" name="2: latest_testflight_build_number" time="6.015111">
<testcase classname="fastlane.lanes" name="2: latest_testflight_build_number" time="7.167423">
</testcase>
<testcase classname="fastlane.lanes" name="3: increment_build_number" time="0.656945">
<testcase classname="fastlane.lanes" name="3: increment_build_number" time="0.654653">
</testcase>
<testcase classname="fastlane.lanes" name="4: build_app" time="75.686541">
<testcase classname="fastlane.lanes" name="4: build_app" time="29.319346">
</testcase>
<testcase classname="fastlane.lanes" name="5: upload_to_testflight" time="68.644406">
<failure message="/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/actions/actions_helper.rb:67:in `execute_action&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:255:in `block in execute_action&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:229:in `chdir&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:229:in `execute_action&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/fast_file.rb:159:in `method_missing&apos;&#10;Fastfile:27:in `block (2 levels) in parsing_binding&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/lane.rb:33:in `call&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:49:in `block in execute&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:45:in `chdir&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/runner.rb:45:in `execute&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/lane_manager.rb:47:in `cruise_lane&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:110:in `block (2 levels) in run&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/command.rb:187:in `call&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/command.rb:157:in `run&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/runner.rb:444:in `run_active_command&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:124:in `run!&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/commander-4.6.0/lib/commander/delegates.rb:18:in `run!&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:354:in `run&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/commands_generator.rb:43:in `start&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/fastlane/lib/fastlane/cli_tools_distributor.rb:123:in `take_off&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/gems/fastlane-2.210.1/bin/fastlane:23:in `&lt;top (required)&gt;&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/bin/fastlane:25:in `load&apos;&#10;/usr/local/Cellar/fastlane/2.210.1/libexec/bin/fastlane:25:in `&lt;main&gt;&apos;&#10;&#10;Error building the application - see the log above" />
</testcase>

View File

@@ -26,6 +26,7 @@ const String backgroundBackupInfoBox = "immichBackgroundBackupInfoBox"; // Box
const String backupFailedSince = "immichBackupFailedSince"; // Key 1
const String backupRequireWifi = "immichBackupRequireWifi"; // Key 2
const String backupRequireCharging = "immichBackupRequireCharging"; // Key 3
const String backupTriggerDelay = "immichBackupTriggerDelay"; // Key 4
// Duplicate asset
const String duplicatedAssetsBox = "immichDuplicatedAssetsBox"; // Box

View File

@@ -1,5 +1,3 @@
import 'dart:math';
import 'package:auto_route/auto_route.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:easy_localization/easy_localization.dart';
@@ -41,7 +39,6 @@ class AlbumThumbnailCard extends StatelessWidget {
buildAlbumThumbnail() {
return CachedNetworkImage(
memCacheHeight: max(400, cardSize.toInt() * 3),
width: cardSize,
height: cardSize,
fit: BoxFit.cover,
@@ -51,7 +48,7 @@ class AlbumThumbnailCard extends StatelessWidget {
type: ThumbnailFormat.JPEG,
),
httpHeaders: {"Authorization": "Bearer ${box.get(accessTokenKey)}"},
cacheKey: "${album.albumThumbnailAssetId}",
cacheKey: getAlbumThumbNailCacheKey(album, type: ThumbnailFormat.JPEG),
);
}

View File

@@ -42,10 +42,9 @@ class SharingPage extends HookConsumerWidget {
child: CachedNetworkImage(
width: 60,
height: 60,
memCacheHeight: 200,
fit: BoxFit.cover,
imageUrl: getAlbumThumbnailUrl(album),
cacheKey: album.albumThumbnailAssetId,
cacheKey: getAlbumThumbNailCacheKey(album),
httpHeaders: {
"Authorization": "Bearer ${box.get(accessTokenKey)}"
},

View File

@@ -20,10 +20,10 @@ class _RemotePhotoViewState extends State<RemotePhotoView> {
@override
Widget build(BuildContext context) {
bool allowMoving = _status == _RemoteImageStatus.full;
final bool forbidZoom = _status == _RemoteImageStatus.thumbnail;
return IgnorePointer(
ignoring: !allowMoving,
ignoring: forbidZoom,
child: Listener(
onPointerMove: handleSwipUpDown,
child: PhotoView(
@@ -115,7 +115,7 @@ class _RemotePhotoViewState extends State<RemotePhotoView> {
_thumbnailProvider = _authorizedImageProvider(
getThumbnailUrl(widget.asset.remote!),
widget.asset.id,
getThumbnailCacheKey(widget.asset.remote!),
);
_imageProvider = _thumbnailProvider;
@@ -128,10 +128,10 @@ class _RemotePhotoViewState extends State<RemotePhotoView> {
}),
);
if (widget.threeStageLoading) {
if (widget.loadPreview) {
_previewProvider = _authorizedImageProvider(
getThumbnailUrl(widget.asset.remote!, type: ThumbnailFormat.JPEG),
"${widget.asset.id}_previewStage",
getThumbnailCacheKey(widget.asset.remote!, type: ThumbnailFormat.JPEG),
);
_previewProvider.resolve(const ImageConfiguration()).addListener(
ImageStreamListener((ImageInfo imageInfo, _) {
@@ -140,15 +140,17 @@ class _RemotePhotoViewState extends State<RemotePhotoView> {
);
}
_fullProvider = _authorizedImageProvider(
getImageUrl(widget.asset.remote!),
"${widget.asset.id}_fullStage",
);
_fullProvider.resolve(const ImageConfiguration()).addListener(
ImageStreamListener((ImageInfo imageInfo, _) {
_performStateTransition(_RemoteImageStatus.full, _fullProvider);
}),
);
if (widget.loadOriginal) {
_fullProvider = _authorizedImageProvider(
getImageUrl(widget.asset.remote!),
getImageCacheKey(widget.asset.remote!),
);
_fullProvider.resolve(const ImageConfiguration()).addListener(
ImageStreamListener((ImageInfo imageInfo, _) {
_performStateTransition(_RemoteImageStatus.full, _fullProvider);
}),
);
}
}
@override
@@ -178,7 +180,8 @@ class RemotePhotoView extends StatefulWidget {
Key? key,
required this.asset,
required this.authToken,
required this.threeStageLoading,
required this.loadPreview,
required this.loadOriginal,
required this.isZoomedFunction,
required this.isZoomedListener,
required this.onSwipeDown,
@@ -187,7 +190,8 @@ class RemotePhotoView extends StatefulWidget {
final Asset asset;
final String authToken;
final bool threeStageLoading;
final bool loadPreview;
final bool loadOriginal;
final void Function() onSwipeDown;
final void Function() onSwipeUp;
final void Function() isZoomedFunction;

View File

@@ -31,8 +31,9 @@ class GalleryViewerPage extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final Box<dynamic> box = Hive.box(userInfoBox);
final appSettingService = ref.watch(appSettingsServiceProvider);
final threeStageLoading = useState(false);
final settings = ref.watch(appSettingsServiceProvider);
final isLoadPreview = useState(AppSettingsEnum.loadPreview.defaultValue);
final isLoadOriginal = useState(AppSettingsEnum.loadOriginal.defaultValue);
final isZoomed = useState<bool>(false);
final indexOfAsset = useState(assetList.indexOf(asset));
final isPlayingMotionVideo = useState(false);
@@ -43,8 +44,10 @@ class GalleryViewerPage extends HookConsumerWidget {
useEffect(
() {
threeStageLoading.value = appSettingService
.getSetting<bool>(AppSettingsEnum.threeStageLoading);
isLoadPreview.value =
settings.getSetting<bool>(AppSettingsEnum.loadPreview);
isLoadOriginal.value =
settings.getSetting<bool>(AppSettingsEnum.loadOriginal);
isPlayingMotionVideo.value = false;
return null;
},
@@ -140,7 +143,8 @@ class GalleryViewerPage extends HookConsumerWidget {
isZoomedListener: isZoomedListener,
asset: assetList[index],
heroTag: assetList[index].id,
threeStageLoading: threeStageLoading.value,
loadPreview: isLoadPreview.value,
loadOriginal: isLoadOriginal.value,
);
}
} else {

View File

@@ -17,7 +17,8 @@ class ImageViewerPage extends HookConsumerWidget {
final String authToken;
final ValueNotifier<bool> isZoomedListener;
final void Function() isZoomedFunction;
final bool threeStageLoading;
final bool loadPreview;
final bool loadOriginal;
ImageViewerPage({
Key? key,
@@ -26,7 +27,8 @@ class ImageViewerPage extends HookConsumerWidget {
required this.authToken,
required this.isZoomedFunction,
required this.isZoomedListener,
required this.threeStageLoading,
required this.loadPreview,
required this.loadOriginal,
}) : super(key: key);
Asset? assetDetail;
@@ -74,7 +76,8 @@ class ImageViewerPage extends HookConsumerWidget {
child: RemotePhotoView(
asset: asset,
authToken: authToken,
threeStageLoading: threeStageLoading,
loadPreview: loadPreview,
loadOriginal: loadOriginal,
isZoomedFunction: isZoomedFunction,
isZoomedListener: isZoomedListener,
onSwipeDown: () => AutoRouter.of(context).pop(),

View File

@@ -86,6 +86,8 @@ class BackgroundService {
Future<bool> configureService({
bool requireUnmetered = true,
bool requireCharging = false,
int triggerUpdateDelay = 5000,
int triggerMaxDelay = 50000,
}) async {
if (!Platform.isAndroid) {
return true;
@@ -93,7 +95,12 @@ class BackgroundService {
try {
final bool ok = await _foregroundChannel.invokeMethod(
'configure',
[requireUnmetered, requireCharging],
[
requireUnmetered,
requireCharging,
triggerUpdateDelay,
triggerMaxDelay
],
);
return ok;
} catch (error) {

View File

@@ -18,6 +18,7 @@ class BackUpState {
final bool backgroundBackup;
final bool backupRequireWifi;
final bool backupRequireCharging;
final int backupTriggerDelay;
/// All available albums on the device
final List<AvailableAlbum> availableAlbums;
@@ -42,6 +43,7 @@ class BackUpState {
required this.backgroundBackup,
required this.backupRequireWifi,
required this.backupRequireCharging,
required this.backupTriggerDelay,
required this.availableAlbums,
required this.selectedBackupAlbums,
required this.excludedBackupAlbums,
@@ -59,6 +61,7 @@ class BackUpState {
bool? backgroundBackup,
bool? backupRequireWifi,
bool? backupRequireCharging,
int? backupTriggerDelay,
List<AvailableAlbum>? availableAlbums,
Set<AvailableAlbum>? selectedBackupAlbums,
Set<AvailableAlbum>? excludedBackupAlbums,
@@ -76,6 +79,7 @@ class BackUpState {
backupRequireWifi: backupRequireWifi ?? this.backupRequireWifi,
backupRequireCharging:
backupRequireCharging ?? this.backupRequireCharging,
backupTriggerDelay: backupTriggerDelay ?? this.backupTriggerDelay,
availableAlbums: availableAlbums ?? this.availableAlbums,
selectedBackupAlbums: selectedBackupAlbums ?? this.selectedBackupAlbums,
excludedBackupAlbums: excludedBackupAlbums ?? this.excludedBackupAlbums,
@@ -88,7 +92,7 @@ class BackUpState {
@override
String toString() {
return 'BackUpState(backupProgress: $backupProgress, allAssetsInDatabase: $allAssetsInDatabase, progressInPercentage: $progressInPercentage, cancelToken: $cancelToken, serverInfo: $serverInfo, backgroundBackup: $backgroundBackup, backupRequireWifi: $backupRequireWifi, backupRequireCharging: $backupRequireCharging, availableAlbums: $availableAlbums, selectedBackupAlbums: $selectedBackupAlbums, excludedBackupAlbums: $excludedBackupAlbums, allUniqueAssets: $allUniqueAssets, selectedAlbumsBackupAssetsIds: $selectedAlbumsBackupAssetsIds, currentUploadAsset: $currentUploadAsset)';
return 'BackUpState(backupProgress: $backupProgress, allAssetsInDatabase: $allAssetsInDatabase, progressInPercentage: $progressInPercentage, cancelToken: $cancelToken, serverInfo: $serverInfo, backgroundBackup: $backgroundBackup, backupRequireWifi: $backupRequireWifi, backupRequireCharging: $backupRequireCharging, backupTriggerDelay: $backupTriggerDelay, availableAlbums: $availableAlbums, selectedBackupAlbums: $selectedBackupAlbums, excludedBackupAlbums: $excludedBackupAlbums, allUniqueAssets: $allUniqueAssets, selectedAlbumsBackupAssetsIds: $selectedAlbumsBackupAssetsIds, currentUploadAsset: $currentUploadAsset)';
}
@override
@@ -105,6 +109,7 @@ class BackUpState {
other.backgroundBackup == backgroundBackup &&
other.backupRequireWifi == backupRequireWifi &&
other.backupRequireCharging == backupRequireCharging &&
other.backupTriggerDelay == backupTriggerDelay &&
collectionEquals(other.availableAlbums, availableAlbums) &&
collectionEquals(other.selectedBackupAlbums, selectedBackupAlbums) &&
collectionEquals(other.excludedBackupAlbums, excludedBackupAlbums) &&
@@ -126,6 +131,7 @@ class BackUpState {
backgroundBackup.hashCode ^
backupRequireWifi.hashCode ^
backupRequireCharging.hashCode ^
backupTriggerDelay.hashCode ^
availableAlbums.hashCode ^
selectedBackupAlbums.hashCode ^
excludedBackupAlbums.hashCode ^

View File

@@ -38,6 +38,7 @@ class BackupNotifier extends StateNotifier<BackUpState> {
backgroundBackup: false,
backupRequireWifi: true,
backupRequireCharging: false,
backupTriggerDelay: 5000,
serverInfo: ServerInfoResponseDto(
diskAvailable: "0",
diskAvailableRaw: 0,
@@ -69,7 +70,6 @@ class BackupNotifier extends StateNotifier<BackUpState> {
final AuthenticationState _authState;
final BackgroundService _backgroundService;
final Ref ref;
var isGettingBackupInfo = false;
///
/// UI INTERACTION
@@ -120,18 +120,26 @@ class BackupNotifier extends StateNotifier<BackUpState> {
bool? enabled,
bool? requireWifi,
bool? requireCharging,
int? triggerDelay,
required void Function(String msg) onError,
required void Function() onBatteryInfo,
}) async {
assert(enabled != null || requireWifi != null || requireCharging != null);
assert(
enabled != null ||
requireWifi != null ||
requireCharging != null ||
triggerDelay != null,
);
if (Platform.isAndroid) {
final bool wasEnabled = state.backgroundBackup;
final bool wasWifi = state.backupRequireWifi;
final bool wasCharing = state.backupRequireCharging;
final bool wasCharging = state.backupRequireCharging;
final int oldTriggerDelay = state.backupTriggerDelay;
state = state.copyWith(
backgroundBackup: enabled,
backupRequireWifi: requireWifi,
backupRequireCharging: requireCharging,
backupTriggerDelay: triggerDelay,
);
if (state.backgroundBackup) {
@@ -146,17 +154,22 @@ class BackupNotifier extends StateNotifier<BackUpState> {
await _backgroundService.configureService(
requireUnmetered: state.backupRequireWifi,
requireCharging: state.backupRequireCharging,
triggerUpdateDelay: state.backupTriggerDelay,
triggerMaxDelay: state.backupTriggerDelay * 10,
);
if (success) {
await Hive.box(backgroundBackupInfoBox)
.put(backupRequireWifi, state.backupRequireWifi);
await Hive.box(backgroundBackupInfoBox)
.put(backupRequireCharging, state.backupRequireCharging);
final box = Hive.box(backgroundBackupInfoBox);
await Future.wait([
box.put(backupRequireWifi, state.backupRequireWifi),
box.put(backupRequireCharging, state.backupRequireCharging),
box.put(backupTriggerDelay, state.backupTriggerDelay),
]);
} else {
state = state.copyWith(
backgroundBackup: wasEnabled,
backupRequireWifi: wasWifi,
backupRequireCharging: wasCharing,
backupRequireCharging: wasCharging,
backupTriggerDelay: oldTriggerDelay,
);
onError("backup_controller_page_background_configure_error");
}
@@ -375,20 +388,14 @@ class BackupNotifier extends StateNotifier<BackUpState> {
/// which albums are selected or excluded
/// and then update the UI according to those information
Future<void> getBackupInfo() async {
if (!isGettingBackupInfo) {
isGettingBackupInfo = true;
var isEnabled = await _backgroundService.isBackgroundBackupEnabled();
var isEnabled = await _backgroundService.isBackgroundBackupEnabled();
state = state.copyWith(backgroundBackup: isEnabled);
state = state.copyWith(backgroundBackup: isEnabled);
if (state.backupProgress != BackUpProgressEnum.inBackground) {
await _getBackupAlbumsInfo();
await _updateServerInfo();
await _updateBackupAssetCount();
}
isGettingBackupInfo = false;
if (state.backupProgress != BackUpProgressEnum.inBackground) {
await _getBackupAlbumsInfo();
await _updateServerInfo();
await _updateBackupAssetCount();
}
}
@@ -415,6 +422,7 @@ class BackupNotifier extends StateNotifier<BackUpState> {
/// Invoke backup process
Future<void> startBackupProcess() async {
debugPrint("Start backup process");
assert(state.backupProgress == BackUpProgressEnum.idle);
state = state.copyWith(backupProgress: BackUpProgressEnum.inProgress);
@@ -431,7 +439,6 @@ class BackupNotifier extends StateNotifier<BackUpState> {
}
Set<AssetEntity> assetsWillBeBackup = Set.from(state.allUniqueAssets);
// Remove item that has already been backed up
for (var assetId in state.allAssetsInDatabase) {
assetsWillBeBackup.removeWhere((e) => e.id == assetId);
@@ -609,6 +616,7 @@ class BackupNotifier extends StateNotifier<BackUpState> {
excludedBackupAlbums: excludedAlbums,
backupRequireWifi: backgroundBox.get(backupRequireWifi),
backupRequireCharging: backgroundBox.get(backupRequireCharging),
backupTriggerDelay: backgroundBox.get(backupTriggerDelay),
);
}
return _resumeBackup();

View File

@@ -376,8 +376,8 @@ class BackupService {
DeviceTypeEnum deviceType,
) async {
try {
var updatedDeviceInfo = await _apiService.deviceInfoApi.updateDeviceInfo(
UpdateDeviceInfoDto(
var updatedDeviceInfo = await _apiService.deviceInfoApi.upsertDeviceInfo(
UpsertDeviceInfoDto(
deviceId: deviceId,
deviceType: deviceType,
isAutoBackup: status,

View File

@@ -198,6 +198,46 @@ class BackupControllerPage extends HookConsumerWidget {
final bool isWifiRequired = backupState.backupRequireWifi;
final bool isChargingRequired = backupState.backupRequireCharging;
final Color activeColor = Theme.of(context).primaryColor;
String formatBackupDelaySliderValue(double v) {
if (v == 0.0) {
return 'setting_notifications_notify_seconds'.tr(args: const ['5']);
} else if (v == 1.0) {
return 'setting_notifications_notify_seconds'.tr(args: const ['30']);
} else if (v == 2.0) {
return 'setting_notifications_notify_minutes'.tr(args: const ['2']);
} else {
return 'setting_notifications_notify_minutes'.tr(args: const ['10']);
}
}
int backupDelayToMilliseconds(double v) {
if (v == 0.0) {
return 5000;
} else if (v == 1.0) {
return 30000;
} else if (v == 2.0) {
return 120000;
} else {
return 600000;
}
}
double backupDelayToSliderValue(int ms) {
if (ms == 5000) {
return 0.0;
} else if (ms == 30000) {
return 1.0;
} else if (ms == 120000) {
return 2.0;
} else {
return 3.0;
}
}
final triggerDelay =
useState(backupDelayToSliderValue(backupState.backupTriggerDelay));
return ListTile(
isThreeLine: true,
leading: isBackgroundEnabled
@@ -264,6 +304,35 @@ class BackupControllerPage extends HookConsumerWidget {
)
: null,
),
if (isBackgroundEnabled)
ListTile(
isThreeLine: false,
dense: true,
enabled: hasExclusiveAccess,
title: const Text(
'backup_controller_page_background_delay',
style: TextStyle(
fontWeight: FontWeight.bold,
),
).tr(args: [formatBackupDelaySliderValue(triggerDelay.value)]),
subtitle: Slider(
value: triggerDelay.value,
onChanged: hasExclusiveAccess
? (double v) => triggerDelay.value = v
: null,
onChangeEnd: (double v) => ref
.read(backupProvider.notifier)
.configureBackgroundBackup(
triggerDelay: backupDelayToMilliseconds(v),
onError: showErrorToUser,
onBatteryInfo: showBatteryOptimizationInfoToUser,
),
max: 3.0,
divisions: 3,
label: formatBackupDelaySliderValue(triggerDelay.value),
activeColor: Theme.of(context).primaryColor,
),
),
ElevatedButton(
onPressed: () =>
ref.read(backupProvider.notifier).configureBackgroundBackup(

View File

@@ -32,20 +32,20 @@ class AssetService {
AssetService(this._apiService, this._backupService, this._backgroundService);
/// Returns `null` if the server state did not change, else list of assets
Future<List<Asset>?> getRemoteAssets({required bool hasCache}) async {
Future<Pair<List<Asset>?, String?>> getRemoteAssets({String? etag}) async {
try {
final Box box = Hive.box(userInfoBox);
final Pair<List<AssetResponseDto>, String?>? remote = await _apiService
.assetApi
.getAllAssetsWithETag(eTag: hasCache ? box.get(assetEtagKey) : null);
final Pair<List<AssetResponseDto>, String?>? remote =
await _apiService.assetApi.getAllAssetsWithETag(eTag: etag);
if (remote == null) {
return null;
return const Pair(null, null);
}
box.put(assetEtagKey, remote.second);
return remote.first.map(Asset.remote).toList(growable: false);
return Pair(
remote.first.map(Asset.remote).toList(growable: false),
remote.second,
);
} catch (e, stack) {
log.severe('Error while getting remote assets', e, stack);
return null;
return const Pair(null, null);
}
}

View File

@@ -75,14 +75,11 @@ class ControlBottomAppBar extends ConsumerWidget {
width: 100,
height: 100,
fit: BoxFit.cover,
imageUrl: getAlbumThumbnailUrl(
album,
type: ThumbnailFormat.JPEG,
),
imageUrl: getAlbumThumbnailUrl(album),
httpHeaders: {
"Authorization": "Bearer ${box.get(accessTokenKey)}"
},
cacheKey: "${album.albumThumbnailAssetId}",
cacheKey: getAlbumThumbNailCacheKey(album),
),
),
Padding(

View File

@@ -210,8 +210,8 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
// Register device info
try {
DeviceInfoResponseDto? deviceInfo =
await _apiService.deviceInfoApi.createDeviceInfo(
CreateDeviceInfoDto(
await _apiService.deviceInfoApi.upsertDeviceInfo(
UpsertDeviceInfoDto(
deviceId: state.deviceId,
deviceType: state.deviceType,
),

View File

@@ -2,7 +2,8 @@ import 'package:hive_flutter/hive_flutter.dart';
import 'package:immich_mobile/constants/hive_box.dart';
enum AppSettingsEnum<T> {
threeStageLoading<bool>("threeStageLoading", false),
loadPreview<bool>("loadPreview", true),
loadOriginal<bool>("loadOriginal", false),
themeMode<String>("themeMode", "system"), // "light","dark","system"
tilesPerRow<int>("tilesPerRow", 4),
uploadErrorNotificationGracePeriod<int>(

View File

@@ -0,0 +1,24 @@
import 'package:flutter/material.dart';
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
SwitchListTile buildSwitchListTile(
BuildContext context,
AppSettingsService appSettingService,
ValueNotifier<bool> valueNotifier,
AppSettingsEnum settingsEnum, {
required String title,
String? subtitle,
}) {
return SwitchListTile.adaptive(
key: Key(settingsEnum.name),
value: valueNotifier.value,
onChanged: (value) {
valueNotifier.value = value;
appSettingService.setSetting(settingsEnum, value);
},
activeColor: Theme.of(context).primaryColor,
dense: true,
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: subtitle != null ? Text(subtitle) : null,
);
}

View File

@@ -1,14 +1,30 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:immich_mobile/modules/settings/ui/image_viewer_quality_setting/three_stage_loading.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
import 'package:immich_mobile/modules/settings/ui/common.dart';
class ImageViewerQualitySetting extends StatelessWidget {
class ImageViewerQualitySetting extends HookConsumerWidget {
const ImageViewerQualitySetting({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
Widget build(BuildContext context, WidgetRef ref) {
final settings = ref.watch(appSettingsServiceProvider);
final isPreview = useState(AppSettingsEnum.loadPreview.defaultValue);
final isOriginal = useState(AppSettingsEnum.loadOriginal.defaultValue);
useEffect(
() {
isPreview.value = settings.getSetting(AppSettingsEnum.loadPreview);
isOriginal.value = settings.getSetting(AppSettingsEnum.loadOriginal);
return null;
},
);
return ExpansionTile(
textColor: Theme.of(context).primaryColor,
title: const Text(
@@ -23,8 +39,27 @@ class ImageViewerQualitySetting extends StatelessWidget {
fontSize: 13,
),
).tr(),
children: const [
ThreeStageLoading(),
children: [
ListTile(
title: const Text('setting_image_viewer_help').tr(),
dense: true,
),
buildSwitchListTile(
context,
settings,
isPreview,
AppSettingsEnum.loadPreview,
title: "setting_image_viewer_preview_title".tr(),
subtitle: "setting_image_viewer_preview_subtitle".tr(),
),
buildSwitchListTile(
context,
settings,
isOriginal,
AppSettingsEnum.loadOriginal,
title: "setting_image_viewer_original_title".tr(),
subtitle: "setting_image_viewer_original_subtitle".tr(),
),
],
);
}

View File

@@ -1,57 +0,0 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
class ThreeStageLoading extends HookConsumerWidget {
const ThreeStageLoading({
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context, WidgetRef ref) {
final appSettingService = ref.watch(appSettingsServiceProvider);
final isEnable = useState(false);
useEffect(
() {
var isThreeStageLoadingEnable =
appSettingService.getSetting(AppSettingsEnum.threeStageLoading);
isEnable.value = isThreeStageLoadingEnable;
return null;
},
[],
);
void onSwitchChanged(bool switchValue) {
appSettingService.setSetting(
AppSettingsEnum.threeStageLoading,
switchValue,
);
isEnable.value = switchValue;
}
return SwitchListTile.adaptive(
activeColor: Theme.of(context).primaryColor,
title: const Text(
"theme_setting_three_stage_loading_title",
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
),
).tr(),
subtitle: const Text(
"theme_setting_three_stage_loading_subtitle",
style: TextStyle(
fontSize: 12,
),
).tr(),
value: isEnable.value,
onChanged: onSwitchChanged,
);
}
}

View File

@@ -4,6 +4,7 @@ import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/modules/settings/providers/app_settings.provider.dart';
import 'package:immich_mobile/modules/settings/services/app_settings.service.dart';
import 'package:immich_mobile/modules/settings/ui/common.dart';
class NotificationSetting extends HookConsumerWidget {
const NotificationSetting({
@@ -50,7 +51,7 @@ class NotificationSetting extends HookConsumerWidget {
),
).tr(),
children: [
_buildSwitchListTile(
buildSwitchListTile(
context,
appSettingService,
totalProgressValue,
@@ -58,7 +59,7 @@ class NotificationSetting extends HookConsumerWidget {
title: 'setting_notifications_total_progress_title'.tr(),
subtitle: 'setting_notifications_total_progress_subtitle'.tr(),
),
_buildSwitchListTile(
buildSwitchListTile(
context,
appSettingService,
singleProgressValue,
@@ -91,28 +92,6 @@ class NotificationSetting extends HookConsumerWidget {
}
}
SwitchListTile _buildSwitchListTile(
BuildContext context,
AppSettingsService appSettingService,
ValueNotifier<bool> valueNotifier,
AppSettingsEnum settingsEnum, {
required String title,
String? subtitle,
}) {
return SwitchListTile(
key: Key(settingsEnum.name),
value: valueNotifier.value,
onChanged: (value) {
valueNotifier.value = value;
appSettingService.setSetting(settingsEnum, value);
},
activeColor: Theme.of(context).primaryColor,
dense: true,
title: Text(title, style: const TextStyle(fontWeight: FontWeight.bold)),
subtitle: subtitle != null ? Text(subtitle) : null,
);
}
String _formatSliderValue(double v) {
if (v == 0.0) {
return 'setting_notifications_notify_immediately'.tr();

View File

@@ -59,7 +59,8 @@ class _$AppRouter extends RootStackRouter {
authToken: args.authToken,
isZoomedFunction: args.isZoomedFunction,
isZoomedListener: args.isZoomedListener,
threeStageLoading: args.threeStageLoading));
loadPreview: args.loadPreview,
loadOriginal: args.loadOriginal));
},
VideoViewerRoute.name: (routeData) {
final args = routeData.argsAs<VideoViewerRouteArgs>();
@@ -305,7 +306,8 @@ class ImageViewerRoute extends PageRouteInfo<ImageViewerRouteArgs> {
required String authToken,
required void Function() isZoomedFunction,
required ValueNotifier<bool> isZoomedListener,
required bool threeStageLoading})
required bool loadPreview,
required bool loadOriginal})
: super(ImageViewerRoute.name,
path: '/image-viewer-page',
args: ImageViewerRouteArgs(
@@ -315,7 +317,8 @@ class ImageViewerRoute extends PageRouteInfo<ImageViewerRouteArgs> {
authToken: authToken,
isZoomedFunction: isZoomedFunction,
isZoomedListener: isZoomedListener,
threeStageLoading: threeStageLoading));
loadPreview: loadPreview,
loadOriginal: loadOriginal));
static const String name = 'ImageViewerRoute';
}
@@ -328,7 +331,8 @@ class ImageViewerRouteArgs {
required this.authToken,
required this.isZoomedFunction,
required this.isZoomedListener,
required this.threeStageLoading});
required this.loadPreview,
required this.loadOriginal});
final Key? key;
@@ -342,11 +346,13 @@ class ImageViewerRouteArgs {
final ValueNotifier<bool> isZoomedListener;
final bool threeStageLoading;
final bool loadPreview;
final bool loadOriginal;
@override
String toString() {
return 'ImageViewerRouteArgs{key: $key, heroTag: $heroTag, asset: $asset, authToken: $authToken, isZoomedFunction: $isZoomedFunction, isZoomedListener: $isZoomedListener, threeStageLoading: $threeStageLoading}';
return 'ImageViewerRouteArgs{key: $key, heroTag: $heroTag, asset: $asset, authToken: $authToken, isZoomedFunction: $isZoomedFunction, isZoomedListener: $isZoomedListener, loadPreview: $loadPreview, loadOriginal: $loadOriginal}';
}
}

View File

@@ -8,6 +8,7 @@ import 'package:immich_mobile/modules/home/services/asset_cache.service.dart';
import 'package:immich_mobile/shared/models/asset.dart';
import 'package:immich_mobile/shared/services/device_info.service.dart';
import 'package:collection/collection.dart';
import 'package:immich_mobile/utils/tuple.dart';
import 'package:intl/intl.dart';
import 'package:logging/logging.dart';
import 'package:openapi/api.dart';
@@ -37,8 +38,11 @@ class AssetNotifier extends StateNotifier<List<Asset>> {
_getAllAssetInProgress = true;
final bool isCacheValid = await _assetCacheService.isValid();
stopwatch.start();
final Box box = Hive.box(userInfoBox);
final localTask = _assetService.getLocalAssets(urgent: !isCacheValid);
final remoteTask = _assetService.getRemoteAssets(hasCache: isCacheValid);
final remoteTask = _assetService.getRemoteAssets(
etag: isCacheValid ? box.get(assetEtagKey) : null,
);
if (isCacheValid && state.isEmpty) {
state = await _assetCacheService.get();
log.info(
@@ -50,7 +54,8 @@ class AssetNotifier extends StateNotifier<List<Asset>> {
int remoteBegin = state.indexWhere((a) => a.isRemote);
remoteBegin = remoteBegin == -1 ? state.length : remoteBegin;
final List<Asset> currentLocal = state.slice(0, remoteBegin);
List<Asset>? newRemote = await remoteTask;
final Pair<List<Asset>?, String?> remoteResult = await remoteTask;
List<Asset>? newRemote = remoteResult.first;
List<Asset>? newLocal = await localTask;
log.info("Load assets: ${stopwatch.elapsedMilliseconds}ms");
stopwatch.reset();
@@ -63,14 +68,14 @@ class AssetNotifier extends StateNotifier<List<Asset>> {
newLocal ??= [];
state = _combineLocalAndRemoteAssets(local: newLocal, remote: newRemote);
log.info("Combining assets: ${stopwatch.elapsedMilliseconds}ms");
stopwatch.reset();
_cacheState();
box.put(assetEtagKey, remoteResult.second);
log.info("Store assets in cache: ${stopwatch.elapsedMilliseconds}ms");
} finally {
_getAllAssetInProgress = false;
}
log.info("setting new asset state");
stopwatch.reset();
_cacheState();
log.info("Store assets in cache: ${stopwatch.elapsedMilliseconds}ms");
}
List<Asset> _combineLocalAndRemoteAssets({

View File

@@ -62,7 +62,7 @@ class ImmichImage extends StatelessWidget {
return CachedNetworkImage(
imageUrl: thumbnailRequestUrl,
httpHeaders: {"Authorization": "Bearer $token"},
cacheKey: 'thumbnail-image-${asset.id}',
cacheKey: getThumbnailCacheKey(asset.remote!),
width: width,
height: height,
// keeping memCacheWidth, memCacheHeight, maxWidthDiskCache and

View File

@@ -10,6 +10,19 @@ String getThumbnailUrl(
return _getThumbnailUrl(asset.id, type: type);
}
String getThumbnailCacheKey(final AssetResponseDto asset,
{ThumbnailFormat type = ThumbnailFormat.WEBP}) {
return _getThumbnailCacheKey(asset.id, type);
}
String _getThumbnailCacheKey(final String id, final ThumbnailFormat type) {
if (type == ThumbnailFormat.WEBP) {
return 'thumbnail-image-$id';
} else {
return '${id}_previewStage';
}
}
String getAlbumThumbnailUrl(
final AlbumResponseDto album, {
ThumbnailFormat type = ThumbnailFormat.WEBP,
@@ -20,11 +33,25 @@ String getAlbumThumbnailUrl(
return _getThumbnailUrl(album.albumThumbnailAssetId!, type: type);
}
String getAlbumThumbNailCacheKey(
final AlbumResponseDto album, {
ThumbnailFormat type = ThumbnailFormat.WEBP,
}) {
if (album.albumThumbnailAssetId == null) {
return '';
}
return _getThumbnailCacheKey(album.albumThumbnailAssetId!, type);
}
String getImageUrl(final AssetResponseDto asset) {
final box = Hive.box(userInfoBox);
return '${box.get(serverEndpointKey)}/asset/file/${asset.id}?isThumb=false';
}
String getImageCacheKey(final AssetResponseDto asset) {
return '${asset.id}_fullStage';
}
String _getThumbnailUrl(
final String id, {
ThumbnailFormat type = ThumbnailFormat.WEBP,

View File

@@ -1,4 +1,5 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
analysis_options.yaml
@@ -23,8 +24,8 @@ doc/CheckDuplicateAssetResponseDto.md
doc/CheckExistingAssetsDto.md
doc/CheckExistingAssetsResponseDto.md
doc/CreateAlbumDto.md
doc/CreateDeviceInfoDto.md
doc/CreateProfileImageResponseDto.md
doc/CreateTagDto.md
doc/CreateUserDto.md
doc/CuratedLocationsResponseDto.md
doc/CuratedObjectsResponseDto.md
@@ -60,15 +61,19 @@ doc/ServerVersionReponseDto.md
doc/SignUpDto.md
doc/SmartInfoResponseDto.md
doc/SystemConfigApi.md
doc/SystemConfigKey.md
doc/SystemConfigResponseDto.md
doc/SystemConfigResponseItem.md
doc/SystemConfigDto.md
doc/SystemConfigFFmpegDto.md
doc/SystemConfigOAuthDto.md
doc/TagApi.md
doc/TagResponseDto.md
doc/TagTypeEnum.md
doc/ThumbnailFormat.md
doc/TimeGroupEnum.md
doc/UpdateAlbumDto.md
doc/UpdateAssetDto.md
doc/UpdateDeviceInfoDto.md
doc/UpdateTagDto.md
doc/UpdateUserDto.md
doc/UpsertDeviceInfoDto.md
doc/UsageByUserDto.md
doc/UserApi.md
doc/UserCountResponseDto.md
@@ -84,6 +89,7 @@ lib/api/job_api.dart
lib/api/o_auth_api.dart
lib/api/server_info_api.dart
lib/api/system_config_api.dart
lib/api/tag_api.dart
lib/api/user_api.dart
lib/api_client.dart
lib/api_exception.dart
@@ -111,8 +117,8 @@ lib/model/check_duplicate_asset_response_dto.dart
lib/model/check_existing_assets_dto.dart
lib/model/check_existing_assets_response_dto.dart
lib/model/create_album_dto.dart
lib/model/create_device_info_dto.dart
lib/model/create_profile_image_response_dto.dart
lib/model/create_tag_dto.dart
lib/model/create_user_dto.dart
lib/model/curated_locations_response_dto.dart
lib/model/curated_objects_response_dto.dart
@@ -143,17 +149,96 @@ lib/model/server_stats_response_dto.dart
lib/model/server_version_reponse_dto.dart
lib/model/sign_up_dto.dart
lib/model/smart_info_response_dto.dart
lib/model/system_config_key.dart
lib/model/system_config_response_dto.dart
lib/model/system_config_response_item.dart
lib/model/system_config_dto.dart
lib/model/system_config_f_fmpeg_dto.dart
lib/model/system_config_o_auth_dto.dart
lib/model/tag_response_dto.dart
lib/model/tag_type_enum.dart
lib/model/thumbnail_format.dart
lib/model/time_group_enum.dart
lib/model/update_album_dto.dart
lib/model/update_asset_dto.dart
lib/model/update_device_info_dto.dart
lib/model/update_tag_dto.dart
lib/model/update_user_dto.dart
lib/model/upsert_device_info_dto.dart
lib/model/usage_by_user_dto.dart
lib/model/user_count_response_dto.dart
lib/model/user_response_dto.dart
lib/model/validate_access_token_response_dto.dart
pubspec.yaml
test/add_assets_dto_test.dart
test/add_assets_response_dto_test.dart
test/add_users_dto_test.dart
test/admin_signup_response_dto_test.dart
test/album_api_test.dart
test/album_count_response_dto_test.dart
test/album_response_dto_test.dart
test/all_job_status_response_dto_test.dart
test/asset_api_test.dart
test/asset_count_by_time_bucket_response_dto_test.dart
test/asset_count_by_time_bucket_test.dart
test/asset_count_by_user_id_response_dto_test.dart
test/asset_file_upload_response_dto_test.dart
test/asset_response_dto_test.dart
test/asset_type_enum_test.dart
test/authentication_api_test.dart
test/check_duplicate_asset_dto_test.dart
test/check_duplicate_asset_response_dto_test.dart
test/check_existing_assets_dto_test.dart
test/check_existing_assets_response_dto_test.dart
test/create_album_dto_test.dart
test/create_profile_image_response_dto_test.dart
test/create_tag_dto_test.dart
test/create_user_dto_test.dart
test/curated_locations_response_dto_test.dart
test/curated_objects_response_dto_test.dart
test/delete_asset_dto_test.dart
test/delete_asset_response_dto_test.dart
test/delete_asset_status_test.dart
test/device_info_api_test.dart
test/device_info_response_dto_test.dart
test/device_type_enum_test.dart
test/exif_response_dto_test.dart
test/get_asset_by_time_bucket_dto_test.dart
test/get_asset_count_by_time_bucket_dto_test.dart
test/job_api_test.dart
test/job_command_dto_test.dart
test/job_command_test.dart
test/job_counts_test.dart
test/job_id_test.dart
test/job_status_response_dto_test.dart
test/login_credential_dto_test.dart
test/login_response_dto_test.dart
test/logout_response_dto_test.dart
test/o_auth_api_test.dart
test/o_auth_callback_dto_test.dart
test/o_auth_config_dto_test.dart
test/o_auth_config_response_dto_test.dart
test/remove_assets_dto_test.dart
test/search_asset_dto_test.dart
test/server_info_api_test.dart
test/server_info_response_dto_test.dart
test/server_ping_response_test.dart
test/server_stats_response_dto_test.dart
test/server_version_reponse_dto_test.dart
test/sign_up_dto_test.dart
test/smart_info_response_dto_test.dart
test/system_config_api_test.dart
test/system_config_dto_test.dart
test/system_config_f_fmpeg_dto_test.dart
test/system_config_o_auth_dto_test.dart
test/tag_api_test.dart
test/tag_response_dto_test.dart
test/tag_type_enum_test.dart
test/thumbnail_format_test.dart
test/time_group_enum_test.dart
test/update_album_dto_test.dart
test/update_asset_dto_test.dart
test/update_tag_dto_test.dart
test/update_user_dto_test.dart
test/upsert_device_info_dto_test.dart
test/usage_by_user_dto_test.dart
test/user_api_test.dart
test/user_count_response_dto_test.dart
test/user_response_dto_test.dart
test/validate_access_token_response_dto_test.dart

View File

@@ -3,7 +3,7 @@ Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.17.0
- API version: 1.38.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements
@@ -93,7 +93,7 @@ Class | Method | HTTP request | Description
*AssetApi* | [**getUserAssetsByDeviceId**](doc//AssetApi.md#getuserassetsbydeviceid) | **GET** /asset/{deviceId} |
*AssetApi* | [**searchAsset**](doc//AssetApi.md#searchasset) | **POST** /asset/search |
*AssetApi* | [**serveFile**](doc//AssetApi.md#servefile) | **GET** /asset/file/{assetId} |
*AssetApi* | [**updateAssetById**](doc//AssetApi.md#updateassetbyid) | **PUT** /asset/assetById/{assetId} |
*AssetApi* | [**updateAsset**](doc//AssetApi.md#updateasset) | **PUT** /asset/{assetId} |
*AssetApi* | [**uploadFile**](doc//AssetApi.md#uploadfile) | **POST** /asset/upload |
*AuthenticationApi* | [**adminSignUp**](doc//AuthenticationApi.md#adminsignup) | **POST** /auth/admin-sign-up |
*AuthenticationApi* | [**login**](doc//AuthenticationApi.md#login) | **POST** /auth/login |
@@ -101,6 +101,7 @@ Class | Method | HTTP request | Description
*AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken |
*DeviceInfoApi* | [**createDeviceInfo**](doc//DeviceInfoApi.md#createdeviceinfo) | **POST** /device-info |
*DeviceInfoApi* | [**updateDeviceInfo**](doc//DeviceInfoApi.md#updatedeviceinfo) | **PATCH** /device-info |
*DeviceInfoApi* | [**upsertDeviceInfo**](doc//DeviceInfoApi.md#upsertdeviceinfo) | **PUT** /device-info |
*JobApi* | [**getAllJobsStatus**](doc//JobApi.md#getalljobsstatus) | **GET** /jobs |
*JobApi* | [**getJobStatus**](doc//JobApi.md#getjobstatus) | **GET** /jobs/{jobId} |
*JobApi* | [**sendJobCommand**](doc//JobApi.md#sendjobcommand) | **PUT** /jobs/{jobId} |
@@ -111,7 +112,13 @@ Class | Method | HTTP request | Description
*ServerInfoApi* | [**getStats**](doc//ServerInfoApi.md#getstats) | **GET** /server-info/stats |
*ServerInfoApi* | [**pingServer**](doc//ServerInfoApi.md#pingserver) | **GET** /server-info/ping |
*SystemConfigApi* | [**getConfig**](doc//SystemConfigApi.md#getconfig) | **GET** /system-config |
*SystemConfigApi* | [**getDefaults**](doc//SystemConfigApi.md#getdefaults) | **GET** /system-config/defaults |
*SystemConfigApi* | [**updateConfig**](doc//SystemConfigApi.md#updateconfig) | **PUT** /system-config |
*TagApi* | [**create**](doc//TagApi.md#create) | **POST** /tag |
*TagApi* | [**delete**](doc//TagApi.md#delete) | **DELETE** /tag/{id} |
*TagApi* | [**findAll**](doc//TagApi.md#findall) | **GET** /tag |
*TagApi* | [**findOne**](doc//TagApi.md#findone) | **GET** /tag/{id} |
*TagApi* | [**update**](doc//TagApi.md#update) | **PATCH** /tag/{id} |
*UserApi* | [**createProfileImage**](doc//UserApi.md#createprofileimage) | **POST** /user/profile-image |
*UserApi* | [**createUser**](doc//UserApi.md#createuser) | **POST** /user |
*UserApi* | [**deleteUser**](doc//UserApi.md#deleteuser) | **DELETE** /user/{userId} |
@@ -144,8 +151,8 @@ Class | Method | HTTP request | Description
- [CheckExistingAssetsDto](doc//CheckExistingAssetsDto.md)
- [CheckExistingAssetsResponseDto](doc//CheckExistingAssetsResponseDto.md)
- [CreateAlbumDto](doc//CreateAlbumDto.md)
- [CreateDeviceInfoDto](doc//CreateDeviceInfoDto.md)
- [CreateProfileImageResponseDto](doc//CreateProfileImageResponseDto.md)
- [CreateTagDto](doc//CreateTagDto.md)
- [CreateUserDto](doc//CreateUserDto.md)
- [CuratedLocationsResponseDto](doc//CuratedLocationsResponseDto.md)
- [CuratedObjectsResponseDto](doc//CuratedObjectsResponseDto.md)
@@ -176,15 +183,18 @@ Class | Method | HTTP request | Description
- [ServerVersionReponseDto](doc//ServerVersionReponseDto.md)
- [SignUpDto](doc//SignUpDto.md)
- [SmartInfoResponseDto](doc//SmartInfoResponseDto.md)
- [SystemConfigKey](doc//SystemConfigKey.md)
- [SystemConfigResponseDto](doc//SystemConfigResponseDto.md)
- [SystemConfigResponseItem](doc//SystemConfigResponseItem.md)
- [SystemConfigDto](doc//SystemConfigDto.md)
- [SystemConfigFFmpegDto](doc//SystemConfigFFmpegDto.md)
- [SystemConfigOAuthDto](doc//SystemConfigOAuthDto.md)
- [TagResponseDto](doc//TagResponseDto.md)
- [TagTypeEnum](doc//TagTypeEnum.md)
- [ThumbnailFormat](doc//ThumbnailFormat.md)
- [TimeGroupEnum](doc//TimeGroupEnum.md)
- [UpdateAlbumDto](doc//UpdateAlbumDto.md)
- [UpdateAssetDto](doc//UpdateAssetDto.md)
- [UpdateDeviceInfoDto](doc//UpdateDeviceInfoDto.md)
- [UpdateTagDto](doc//UpdateTagDto.md)
- [UpdateUserDto](doc//UpdateUserDto.md)
- [UpsertDeviceInfoDto](doc//UpsertDeviceInfoDto.md)
- [UsageByUserDto](doc//UsageByUserDto.md)
- [UserCountResponseDto](doc//UserCountResponseDto.md)
- [UserResponseDto](doc//UserResponseDto.md)

View File

@@ -26,7 +26,7 @@ Method | HTTP request | Description
[**getUserAssetsByDeviceId**](AssetApi.md#getuserassetsbydeviceid) | **GET** /asset/{deviceId} |
[**searchAsset**](AssetApi.md#searchasset) | **POST** /asset/search |
[**serveFile**](AssetApi.md#servefile) | **GET** /asset/file/{assetId} |
[**updateAssetById**](AssetApi.md#updateassetbyid) | **PUT** /asset/assetById/{assetId} |
[**updateAsset**](AssetApi.md#updateasset) | **PUT** /asset/{assetId} |
[**uploadFile**](AssetApi.md#uploadfile) | **POST** /asset/upload |
@@ -833,8 +833,8 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateAssetById**
> AssetResponseDto updateAssetById(assetId, updateAssetDto)
# **updateAsset**
> AssetResponseDto updateAsset(assetId, updateAssetDto)
@@ -855,10 +855,10 @@ final assetId = assetId_example; // String |
final updateAssetDto = UpdateAssetDto(); // UpdateAssetDto |
try {
final result = api_instance.updateAssetById(assetId, updateAssetDto);
final result = api_instance.updateAsset(assetId, updateAssetDto);
print(result);
} catch (e) {
print('Exception when calling AssetApi->updateAssetById: $e\n');
print('Exception when calling AssetApi->updateAsset: $e\n');
}
```

View File

@@ -25,6 +25,7 @@ Name | Type | Description | Notes
**exifInfo** | [**ExifResponseDto**](ExifResponseDto.md) | | [optional]
**smartInfo** | [**SmartInfoResponseDto**](SmartInfoResponseDto.md) | | [optional]
**livePhotoVideoId** | **String** | | [optional]
**tags** | [**List<TagResponseDto>**](TagResponseDto.md) | | [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,105 +0,0 @@
# openapi.api.ConfigApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getSystemConfig**](ConfigApi.md#getsystemconfig) | **GET** /config/system |
[**updateSystemConfig**](ConfigApi.md#updatesystemconfig) | **PUT** /config/system |
# **getSystemConfig**
> SystemConfigResponseDto getSystemConfig()
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ConfigApi();
try {
final result = api_instance.getSystemConfig();
print(result);
} catch (e) {
print('Exception when calling ConfigApi->getSystemConfig: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**SystemConfigResponseDto**](SystemConfigResponseDto.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateSystemConfig**
> SystemConfigResponseDto updateSystemConfig(body)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ConfigApi();
final body = Object(); // Object |
try {
final result = api_instance.updateSystemConfig(body);
print(result);
} catch (e) {
print('Exception when calling ConfigApi->updateSystemConfig: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| |
### Return type
[**SystemConfigResponseDto**](SystemConfigResponseDto.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.AssetCountResponseDto
# openapi.model.CreateTagDto
## Load the model package
```dart
@@ -8,8 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**photos** | **int** | |
**videos** | **int** | |
**type** | [**TagTypeEnum**](TagTypeEnum.md) | |
**name** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -11,13 +11,16 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**createDeviceInfo**](DeviceInfoApi.md#createdeviceinfo) | **POST** /device-info |
[**updateDeviceInfo**](DeviceInfoApi.md#updatedeviceinfo) | **PATCH** /device-info |
[**upsertDeviceInfo**](DeviceInfoApi.md#upsertdeviceinfo) | **PUT** /device-info |
# **createDeviceInfo**
> DeviceInfoResponseDto createDeviceInfo(createDeviceInfoDto)
> DeviceInfoResponseDto createDeviceInfo(upsertDeviceInfoDto)
@deprecated
### Example
```dart
import 'package:openapi/api.dart';
@@ -29,10 +32,10 @@ import 'package:openapi/api.dart';
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = DeviceInfoApi();
final createDeviceInfoDto = CreateDeviceInfoDto(); // CreateDeviceInfoDto |
final upsertDeviceInfoDto = UpsertDeviceInfoDto(); // UpsertDeviceInfoDto |
try {
final result = api_instance.createDeviceInfo(createDeviceInfoDto);
final result = api_instance.createDeviceInfo(upsertDeviceInfoDto);
print(result);
} catch (e) {
print('Exception when calling DeviceInfoApi->createDeviceInfo: $e\n');
@@ -43,7 +46,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**createDeviceInfoDto** | [**CreateDeviceInfoDto**](CreateDeviceInfoDto.md)| |
**upsertDeviceInfoDto** | [**UpsertDeviceInfoDto**](UpsertDeviceInfoDto.md)| |
### Return type
@@ -61,10 +64,12 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateDeviceInfo**
> DeviceInfoResponseDto updateDeviceInfo(updateDeviceInfoDto)
> DeviceInfoResponseDto updateDeviceInfo(upsertDeviceInfoDto)
@deprecated
### Example
```dart
import 'package:openapi/api.dart';
@@ -76,10 +81,10 @@ import 'package:openapi/api.dart';
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = DeviceInfoApi();
final updateDeviceInfoDto = UpdateDeviceInfoDto(); // UpdateDeviceInfoDto |
final upsertDeviceInfoDto = UpsertDeviceInfoDto(); // UpsertDeviceInfoDto |
try {
final result = api_instance.updateDeviceInfo(updateDeviceInfoDto);
final result = api_instance.updateDeviceInfo(upsertDeviceInfoDto);
print(result);
} catch (e) {
print('Exception when calling DeviceInfoApi->updateDeviceInfo: $e\n');
@@ -90,7 +95,54 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**updateDeviceInfoDto** | [**UpdateDeviceInfoDto**](UpdateDeviceInfoDto.md)| |
**upsertDeviceInfoDto** | [**UpsertDeviceInfoDto**](UpsertDeviceInfoDto.md)| |
### Return type
[**DeviceInfoResponseDto**](DeviceInfoResponseDto.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upsertDeviceInfo**
> DeviceInfoResponseDto upsertDeviceInfo(upsertDeviceInfoDto)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = DeviceInfoApi();
final upsertDeviceInfoDto = UpsertDeviceInfoDto(); // UpsertDeviceInfoDto |
try {
final result = api_instance.upsertDeviceInfo(upsertDeviceInfoDto);
print(result);
} catch (e) {
print('Exception when calling DeviceInfoApi->upsertDeviceInfo: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**upsertDeviceInfoDto** | [**UpsertDeviceInfoDto**](UpsertDeviceInfoDto.md)| |
### Return type

View File

@@ -1,15 +0,0 @@
# openapi.model.GetAssetCountByTimeGroupDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**timeGroup** | [**TimeGroupEnum**](TimeGroupEnum.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -10,11 +10,12 @@ All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getConfig**](SystemConfigApi.md#getconfig) | **GET** /system-config |
[**getDefaults**](SystemConfigApi.md#getdefaults) | **GET** /system-config/defaults |
[**updateConfig**](SystemConfigApi.md#updateconfig) | **PUT** /system-config |
# **getConfig**
> SystemConfigResponseDto getConfig()
> SystemConfigDto getConfig()
@@ -43,7 +44,7 @@ This endpoint does not need any parameter.
### Return type
[**SystemConfigResponseDto**](SystemConfigResponseDto.md)
[**SystemConfigDto**](SystemConfigDto.md)
### Authorization
@@ -56,8 +57,8 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateConfig**
> SystemConfigResponseDto updateConfig(body)
# **getDefaults**
> SystemConfigDto getDefaults()
@@ -72,10 +73,53 @@ import 'package:openapi/api.dart';
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SystemConfigApi();
final body = Object(); // Object |
try {
final result = api_instance.updateConfig(body);
final result = api_instance.getDefaults();
print(result);
} catch (e) {
print('Exception when calling SystemConfigApi->getDefaults: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**SystemConfigDto**](SystemConfigDto.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **updateConfig**
> SystemConfigDto updateConfig(systemConfigDto)
### Example
```dart
import 'package:openapi/api.dart';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = SystemConfigApi();
final systemConfigDto = SystemConfigDto(); // SystemConfigDto |
try {
final result = api_instance.updateConfig(systemConfigDto);
print(result);
} catch (e) {
print('Exception when calling SystemConfigApi->updateConfig: $e\n');
@@ -86,11 +130,11 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **Object**| |
**systemConfigDto** | [**SystemConfigDto**](SystemConfigDto.md)| |
### Return type
[**SystemConfigResponseDto**](SystemConfigResponseDto.md)
[**SystemConfigDto**](SystemConfigDto.md)
### Authorization

View File

@@ -1,4 +1,4 @@
# openapi.model.AdminConfigResponseDto
# openapi.model.SystemConfigDto
## Load the model package
```dart
@@ -8,7 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**config** | [**Object**](.md) | |
**ffmpeg** | [**SystemConfigFFmpegDto**](SystemConfigFFmpegDto.md) | |
**oauth** | [**SystemConfigOAuthDto**](SystemConfigOAuthDto.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,16 +0,0 @@
# openapi.model.SystemConfigEntity
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**key** | **String** | |
**value** | [**Object**](.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.AssetCountByTimeGroupResponseDto
# openapi.model.SystemConfigFFmpegDto
## Load the model package
```dart
@@ -8,8 +8,11 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int** | |
**buckets** | [**List<AssetCountByTimeBucketResponseDto>**](AssetCountByTimeBucketResponseDto.md) | | [default to const []]
**crf** | **String** | |
**preset** | **String** | |
**targetVideoCodec** | **String** | |
**targetAudioCodec** | **String** | |
**targetScaling** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,14 +0,0 @@
# openapi.model.SystemConfigKey
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.AssetCountByTimeGroupDto
# openapi.model.SystemConfigOAuthDto
## Load the model package
```dart
@@ -8,8 +8,13 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**timeGroup** | **String** | |
**count** | **int** | |
**enabled** | **bool** | |
**issuerUrl** | **String** | |
**clientId** | **String** | |
**clientSecret** | **String** | |
**scope** | **String** | |
**buttonText** | **String** | |
**autoRegister** | **bool** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,15 +0,0 @@
# openapi.model.SystemConfigResponseDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**config** | [**List<SystemConfigResponseItem>**](SystemConfigResponseItem.md) | | [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

220
mobile/openapi/doc/TagApi.md generated Normal file
View File

@@ -0,0 +1,220 @@
# openapi.api.TagApi
## Load the API package
```dart
import 'package:openapi/api.dart';
```
All URIs are relative to */api*
Method | HTTP request | Description
------------- | ------------- | -------------
[**create**](TagApi.md#create) | **POST** /tag |
[**delete**](TagApi.md#delete) | **DELETE** /tag/{id} |
[**findAll**](TagApi.md#findall) | **GET** /tag |
[**findOne**](TagApi.md#findone) | **GET** /tag/{id} |
[**update**](TagApi.md#update) | **PATCH** /tag/{id} |
# **create**
> TagResponseDto create(createTagDto)
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = TagApi();
final createTagDto = CreateTagDto(); // CreateTagDto |
try {
final result = api_instance.create(createTagDto);
print(result);
} catch (e) {
print('Exception when calling TagApi->create: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**createTagDto** | [**CreateTagDto**](CreateTagDto.md)| |
### Return type
[**TagResponseDto**](TagResponseDto.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **delete**
> delete(id)
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = TagApi();
final id = id_example; // String |
try {
api_instance.delete(id);
} catch (e) {
print('Exception when calling TagApi->delete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findAll**
> List<TagResponseDto> findAll()
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = TagApi();
try {
final result = api_instance.findAll();
print(result);
} catch (e) {
print('Exception when calling TagApi->findAll: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List<TagResponseDto>**](TagResponseDto.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findOne**
> TagResponseDto findOne(id)
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = TagApi();
final id = id_example; // String |
try {
final result = api_instance.findOne(id);
print(result);
} catch (e) {
print('Exception when calling TagApi->findOne: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**TagResponseDto**](TagResponseDto.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update**
> TagResponseDto update(id, updateTagDto)
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = TagApi();
final id = id_example; // String |
final updateTagDto = UpdateTagDto(); // UpdateTagDto |
try {
final result = api_instance.update(id, updateTagDto);
print(result);
} catch (e) {
print('Exception when calling TagApi->update: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
**updateTagDto** | [**UpdateTagDto**](UpdateTagDto.md)| |
### Return type
[**TagResponseDto**](TagResponseDto.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.SystemConfigResponseItem
# openapi.model.TagResponseDto
## Load the model package
```dart
@@ -8,10 +8,11 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**type** | [**TagTypeEnum**](TagTypeEnum.md) | |
**name** | **String** | |
**key** | [**SystemConfigKey**](SystemConfigKey.md) | |
**value** | **String** | |
**defaultValue** | **String** | |
**userId** | **String** | |
**renameTagId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.JobType
# openapi.model.TagTypeEnum
## Load the model package
```dart

View File

@@ -1,14 +0,0 @@
# openapi.model.TimeBucketEnum
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -8,7 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**isFavorite** | **bool** | |
**tagIds** | **List<String>** | | [optional] [default to const []]
**isFavorite** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,17 +0,0 @@
# openapi.model.UpdateDeviceInfoDto
## Load the model package
```dart
import 'package:openapi/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**deviceType** | [**DeviceTypeEnum**](DeviceTypeEnum.md) | |
**deviceId** | **String** | |
**isAutoBackup** | **bool** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.CreateJobDto
# openapi.model.UpdateTagDto
## Load the model package
```dart
@@ -8,7 +8,8 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**jobType** | [**JobType**](JobType.md) | |
**name** | **String** | | [optional]
**renameTagId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -1,4 +1,4 @@
# openapi.model.CreateDeviceInfoDto
# openapi.model.UpsertDeviceInfoDto
## Load the model package
```dart

View File

@@ -335,7 +335,7 @@ No authorization required
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **getUserCount**
> UserCountResponseDto getUserCount()
> UserCountResponseDto getUserCount(admin)
@@ -344,9 +344,10 @@ No authorization required
import 'package:openapi/api.dart';
final api_instance = UserApi();
final admin = true; // bool |
try {
final result = api_instance.getUserCount();
final result = api_instance.getUserCount(admin);
print(result);
} catch (e) {
print('Exception when calling UserApi->getUserCount: $e\n');
@@ -354,7 +355,10 @@ try {
```
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**admin** | **bool**| | [optional] [default to false]
### Return type

View File

@@ -35,6 +35,7 @@ part 'api/job_api.dart';
part 'api/o_auth_api.dart';
part 'api/server_info_api.dart';
part 'api/system_config_api.dart';
part 'api/tag_api.dart';
part 'api/user_api.dart';
part 'model/add_assets_dto.dart';
@@ -55,8 +56,8 @@ part 'model/check_duplicate_asset_response_dto.dart';
part 'model/check_existing_assets_dto.dart';
part 'model/check_existing_assets_response_dto.dart';
part 'model/create_album_dto.dart';
part 'model/create_device_info_dto.dart';
part 'model/create_profile_image_response_dto.dart';
part 'model/create_tag_dto.dart';
part 'model/create_user_dto.dart';
part 'model/curated_locations_response_dto.dart';
part 'model/curated_objects_response_dto.dart';
@@ -87,15 +88,18 @@ part 'model/server_stats_response_dto.dart';
part 'model/server_version_reponse_dto.dart';
part 'model/sign_up_dto.dart';
part 'model/smart_info_response_dto.dart';
part 'model/system_config_key.dart';
part 'model/system_config_response_dto.dart';
part 'model/system_config_response_item.dart';
part 'model/system_config_dto.dart';
part 'model/system_config_f_fmpeg_dto.dart';
part 'model/system_config_o_auth_dto.dart';
part 'model/tag_response_dto.dart';
part 'model/tag_type_enum.dart';
part 'model/thumbnail_format.dart';
part 'model/time_group_enum.dart';
part 'model/update_album_dto.dart';
part 'model/update_asset_dto.dart';
part 'model/update_device_info_dto.dart';
part 'model/update_tag_dto.dart';
part 'model/update_user_dto.dart';
part 'model/upsert_device_info_dto.dart';
part 'model/usage_by_user_dto.dart';
part 'model/user_count_response_dto.dart';
part 'model/user_response_dto.dart';

View File

@@ -16,8 +16,6 @@ class AssetApi {
final ApiClient apiClient;
///
///
/// Check duplicated asset before uploading - for Web upload used
///
/// Note: This method returns the HTTP [Response].
@@ -50,8 +48,6 @@ class AssetApi {
);
}
///
///
/// Check duplicated asset before uploading - for Web upload used
///
/// Parameters:
@@ -72,8 +68,6 @@ class AssetApi {
return null;
}
///
///
/// Checks if multiple assets exist on the server and returns all existing - used by background backup
///
/// Note: This method returns the HTTP [Response].
@@ -106,8 +100,6 @@ class AssetApi {
);
}
///
///
/// Checks if multiple assets exist on the server and returns all existing - used by background backup
///
/// Parameters:
@@ -292,8 +284,6 @@ class AssetApi {
return null;
}
///
///
/// Get all AssetEntity belong to the user
///
/// Note: This method returns the HTTP [Response].
@@ -331,8 +321,6 @@ class AssetApi {
);
}
///
///
/// Get all AssetEntity belong to the user
///
/// Parameters:
@@ -357,8 +345,6 @@ class AssetApi {
return null;
}
///
///
/// Get a single asset's information
///
/// Note: This method returns the HTTP [Response].
@@ -392,8 +378,6 @@ class AssetApi {
);
}
///
///
/// Get a single asset's information
///
/// Parameters:
@@ -740,8 +724,6 @@ class AssetApi {
return null;
}
///
///
/// Get all asset of a device that are in the database, ID only.
///
/// Note: This method returns the HTTP [Response].
@@ -775,8 +757,6 @@ class AssetApi {
);
}
///
///
/// Get all asset of a device that are in the database, ID only.
///
/// Parameters:
@@ -913,8 +893,6 @@ class AssetApi {
return null;
}
///
///
/// Update an asset
///
/// Note: This method returns the HTTP [Response].
@@ -924,9 +902,9 @@ class AssetApi {
/// * [String] assetId (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future<Response> updateAssetByIdWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
Future<Response> updateAssetWithHttpInfo(String assetId, UpdateAssetDto updateAssetDto,) async {
// ignore: prefer_const_declarations
final path = r'/asset/assetById/{assetId}'
final path = r'/asset/{assetId}'
.replaceAll('{assetId}', assetId);
// ignore: prefer_final_locals
@@ -950,8 +928,6 @@ class AssetApi {
);
}
///
///
/// Update an asset
///
/// Parameters:
@@ -959,8 +935,8 @@ class AssetApi {
/// * [String] assetId (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future<AssetResponseDto?> updateAssetById(String assetId, UpdateAssetDto updateAssetDto,) async {
final response = await updateAssetByIdWithHttpInfo(assetId, updateAssetDto,);
Future<AssetResponseDto?> updateAsset(String assetId, UpdateAssetDto updateAssetDto,) async {
final response = await updateAssetWithHttpInfo(assetId, updateAssetDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}

View File

@@ -1,106 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ConfigApi {
ConfigApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'GET /config/system' operation and returns the [Response].
Future<Response> getSystemConfigWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/config/system';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<SystemConfigResponseDto?> getSystemConfig() async {
final response = await getSystemConfigWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
}
return null;
}
/// Performs an HTTP 'PUT /config/system' operation and returns the [Response].
/// Parameters:
///
/// * [Object] body (required):
Future<Response> updateSystemConfigWithHttpInfo(Object body,) async {
// ignore: prefer_const_declarations
final path = r'/config/system';
// ignore: prefer_final_locals
Object? postBody = body;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [Object] body (required):
Future<SystemConfigResponseDto?> updateSystemConfig(Object body,) async {
final response = await updateSystemConfigWithHttpInfo(body,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
}
return null;
}
}

View File

@@ -16,16 +16,19 @@ class DeviceInfoApi {
final ApiClient apiClient;
/// Performs an HTTP 'POST /device-info' operation and returns the [Response].
/// @deprecated
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [CreateDeviceInfoDto] createDeviceInfoDto (required):
Future<Response> createDeviceInfoWithHttpInfo(CreateDeviceInfoDto createDeviceInfoDto,) async {
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<Response> createDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
// ignore: prefer_const_declarations
final path = r'/device-info';
// ignore: prefer_final_locals
Object? postBody = createDeviceInfoDto;
Object? postBody = upsertDeviceInfoDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
@@ -45,11 +48,13 @@ class DeviceInfoApi {
);
}
/// @deprecated
///
/// Parameters:
///
/// * [CreateDeviceInfoDto] createDeviceInfoDto (required):
Future<DeviceInfoResponseDto?> createDeviceInfo(CreateDeviceInfoDto createDeviceInfoDto,) async {
final response = await createDeviceInfoWithHttpInfo(createDeviceInfoDto,);
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<DeviceInfoResponseDto?> createDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
final response = await createDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -63,16 +68,19 @@ class DeviceInfoApi {
return null;
}
/// Performs an HTTP 'PATCH /device-info' operation and returns the [Response].
/// @deprecated
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [UpdateDeviceInfoDto] updateDeviceInfoDto (required):
Future<Response> updateDeviceInfoWithHttpInfo(UpdateDeviceInfoDto updateDeviceInfoDto,) async {
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<Response> updateDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
// ignore: prefer_const_declarations
final path = r'/device-info';
// ignore: prefer_final_locals
Object? postBody = updateDeviceInfoDto;
Object? postBody = upsertDeviceInfoDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
@@ -92,11 +100,60 @@ class DeviceInfoApi {
);
}
/// @deprecated
///
/// Parameters:
///
/// * [UpdateDeviceInfoDto] updateDeviceInfoDto (required):
Future<DeviceInfoResponseDto?> updateDeviceInfo(UpdateDeviceInfoDto updateDeviceInfoDto,) async {
final response = await updateDeviceInfoWithHttpInfo(updateDeviceInfoDto,);
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<DeviceInfoResponseDto?> updateDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
final response = await updateDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceInfoResponseDto',) as DeviceInfoResponseDto;
}
return null;
}
/// Performs an HTTP 'PUT /device-info' operation and returns the [Response].
/// Parameters:
///
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<Response> upsertDeviceInfoWithHttpInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
// ignore: prefer_const_declarations
final path = r'/device-info';
// ignore: prefer_final_locals
Object? postBody = upsertDeviceInfoDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [UpsertDeviceInfoDto] upsertDeviceInfoDto (required):
Future<DeviceInfoResponseDto?> upsertDeviceInfo(UpsertDeviceInfoDto upsertDeviceInfoDto,) async {
final response = await upsertDeviceInfoWithHttpInfo(upsertDeviceInfoDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}

View File

@@ -42,7 +42,7 @@ class SystemConfigApi {
);
}
Future<SystemConfigResponseDto?> getConfig() async {
Future<SystemConfigDto?> getConfig() async {
final response = await getConfigWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
@@ -51,7 +51,48 @@ class SystemConfigApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
}
return null;
}
/// Performs an HTTP 'GET /system-config/defaults' operation and returns the [Response].
Future<Response> getDefaultsWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/system-config/defaults';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<SystemConfigDto?> getDefaults() async {
final response = await getDefaultsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
}
return null;
@@ -60,13 +101,13 @@ class SystemConfigApi {
/// Performs an HTTP 'PUT /system-config' operation and returns the [Response].
/// Parameters:
///
/// * [Object] body (required):
Future<Response> updateConfigWithHttpInfo(Object body,) async {
/// * [SystemConfigDto] systemConfigDto (required):
Future<Response> updateConfigWithHttpInfo(SystemConfigDto systemConfigDto,) async {
// ignore: prefer_const_declarations
final path = r'/system-config';
// ignore: prefer_final_locals
Object? postBody = body;
Object? postBody = systemConfigDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
@@ -88,9 +129,9 @@ class SystemConfigApi {
/// Parameters:
///
/// * [Object] body (required):
Future<SystemConfigResponseDto?> updateConfig(Object body,) async {
final response = await updateConfigWithHttpInfo(body,);
/// * [SystemConfigDto] systemConfigDto (required):
Future<SystemConfigDto?> updateConfig(SystemConfigDto systemConfigDto,) async {
final response = await updateConfigWithHttpInfo(systemConfigDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -98,7 +139,7 @@ class SystemConfigApi {
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigResponseDto',) as SystemConfigResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
}
return null;

249
mobile/openapi/lib/api/tag_api.dart generated Normal file
View File

@@ -0,0 +1,249 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class TagApi {
TagApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /tag' operation and returns the [Response].
/// Parameters:
///
/// * [CreateTagDto] createTagDto (required):
Future<Response> createWithHttpInfo(CreateTagDto createTagDto,) async {
// ignore: prefer_const_declarations
final path = r'/tag';
// ignore: prefer_final_locals
Object? postBody = createTagDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [CreateTagDto] createTagDto (required):
Future<TagResponseDto?> create(CreateTagDto createTagDto,) async {
final response = await createWithHttpInfo(createTagDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
}
/// Performs an HTTP 'DELETE /tag/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/tag/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<void> delete(String id,) async {
final response = await deleteWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Performs an HTTP 'GET /tag' operation and returns the [Response].
Future<Response> findAllWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/tag';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<TagResponseDto>?> findAll() async {
final response = await findAllWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<TagResponseDto>') as List)
.cast<TagResponseDto>()
.toList();
}
return null;
}
/// Performs an HTTP 'GET /tag/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> findOneWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/tag/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<TagResponseDto?> findOne(String id,) async {
final response = await findOneWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
}
/// Performs an HTTP 'PATCH /tag/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateTagDto] updateTagDto (required):
Future<Response> updateWithHttpInfo(String id, UpdateTagDto updateTagDto,) async {
// ignore: prefer_const_declarations
final path = r'/tag/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updateTagDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateTagDto] updateTagDto (required):
Future<TagResponseDto?> update(String id, UpdateTagDto updateTagDto,) async {
final response = await updateWithHttpInfo(id, updateTagDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
}
}

View File

@@ -358,7 +358,10 @@ class UserApi {
}
/// Performs an HTTP 'GET /user/count' operation and returns the [Response].
Future<Response> getUserCountWithHttpInfo() async {
/// Parameters:
///
/// * [bool] admin:
Future<Response> getUserCountWithHttpInfo({ bool? admin, }) async {
// ignore: prefer_const_declarations
final path = r'/user/count';
@@ -369,6 +372,10 @@ class UserApi {
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (admin != null) {
queryParams.addAll(_queryParams('', 'admin', admin));
}
const contentTypes = <String>[];
@@ -383,8 +390,11 @@ class UserApi {
);
}
Future<UserCountResponseDto?> getUserCount() async {
final response = await getUserCountWithHttpInfo();
/// Parameters:
///
/// * [bool] admin:
Future<UserCountResponseDto?> getUserCount({ bool? admin, }) async {
final response = await getUserCountWithHttpInfo( admin: admin, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}

View File

@@ -228,10 +228,10 @@ class ApiClient {
return CheckExistingAssetsResponseDto.fromJson(value);
case 'CreateAlbumDto':
return CreateAlbumDto.fromJson(value);
case 'CreateDeviceInfoDto':
return CreateDeviceInfoDto.fromJson(value);
case 'CreateProfileImageResponseDto':
return CreateProfileImageResponseDto.fromJson(value);
case 'CreateTagDto':
return CreateTagDto.fromJson(value);
case 'CreateUserDto':
return CreateUserDto.fromJson(value);
case 'CuratedLocationsResponseDto':
@@ -292,12 +292,16 @@ class ApiClient {
return SignUpDto.fromJson(value);
case 'SmartInfoResponseDto':
return SmartInfoResponseDto.fromJson(value);
case 'SystemConfigKey':
return SystemConfigKeyTypeTransformer().decode(value);
case 'SystemConfigResponseDto':
return SystemConfigResponseDto.fromJson(value);
case 'SystemConfigResponseItem':
return SystemConfigResponseItem.fromJson(value);
case 'SystemConfigDto':
return SystemConfigDto.fromJson(value);
case 'SystemConfigFFmpegDto':
return SystemConfigFFmpegDto.fromJson(value);
case 'SystemConfigOAuthDto':
return SystemConfigOAuthDto.fromJson(value);
case 'TagResponseDto':
return TagResponseDto.fromJson(value);
case 'TagTypeEnum':
return TagTypeEnumTypeTransformer().decode(value);
case 'ThumbnailFormat':
return ThumbnailFormatTypeTransformer().decode(value);
case 'TimeGroupEnum':
@@ -306,10 +310,12 @@ class ApiClient {
return UpdateAlbumDto.fromJson(value);
case 'UpdateAssetDto':
return UpdateAssetDto.fromJson(value);
case 'UpdateDeviceInfoDto':
return UpdateDeviceInfoDto.fromJson(value);
case 'UpdateTagDto':
return UpdateTagDto.fromJson(value);
case 'UpdateUserDto':
return UpdateUserDto.fromJson(value);
case 'UpsertDeviceInfoDto':
return UpsertDeviceInfoDto.fromJson(value);
case 'UsageByUserDto':
return UsageByUserDto.fromJson(value);
case 'UserCountResponseDto':

View File

@@ -70,8 +70,8 @@ String parameterToString(dynamic value) {
if (value is JobId) {
return JobIdTypeTransformer().encode(value).toString();
}
if (value is SystemConfigKey) {
return SystemConfigKeyTypeTransformer().encode(value).toString();
if (value is TagTypeEnum) {
return TagTypeEnumTypeTransformer().encode(value).toString();
}
if (value is ThumbnailFormat) {
return ThumbnailFormatTypeTransformer().encode(value).toString();

View File

@@ -1,111 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AdminConfigResponseDto {
/// Returns a new [AdminConfigResponseDto] instance.
AdminConfigResponseDto({
required this.config,
});
Object config;
@override
bool operator ==(Object other) => identical(this, other) || other is AdminConfigResponseDto &&
other.config == config;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(config.hashCode);
@override
String toString() => 'AdminConfigResponseDto[config=$config]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'config'] = config;
return _json;
}
/// Returns a new [AdminConfigResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AdminConfigResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AdminConfigResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AdminConfigResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AdminConfigResponseDto(
config: mapValueOfType<Object>(json, r'config')!,
);
}
return null;
}
static List<AdminConfigResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AdminConfigResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AdminConfigResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AdminConfigResponseDto> mapFromJson(dynamic json) {
final map = <String, AdminConfigResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AdminConfigResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AdminConfigResponseDto-objects as value to a dart map
static Map<String, List<AdminConfigResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AdminConfigResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AdminConfigResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'config',
};
}

View File

@@ -43,51 +43,48 @@ class AlbumResponseDto {
List<AssetResponseDto> assets;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AlbumResponseDto &&
other.assetCount == assetCount &&
other.id == id &&
other.ownerId == ownerId &&
other.albumName == albumName &&
other.createdAt == createdAt &&
other.albumThumbnailAssetId == albumThumbnailAssetId &&
other.shared == shared &&
other.sharedUsers == sharedUsers &&
other.assets == assets;
bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto &&
other.assetCount == assetCount &&
other.id == id &&
other.ownerId == ownerId &&
other.albumName == albumName &&
other.createdAt == createdAt &&
other.albumThumbnailAssetId == albumThumbnailAssetId &&
other.shared == shared &&
other.sharedUsers == sharedUsers &&
other.assets == assets;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetCount.hashCode) +
(id.hashCode) +
(ownerId.hashCode) +
(albumName.hashCode) +
(createdAt.hashCode) +
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
(shared.hashCode) +
(sharedUsers.hashCode) +
(assets.hashCode);
// ignore: unnecessary_parenthesis
(assetCount.hashCode) +
(id.hashCode) +
(ownerId.hashCode) +
(albumName.hashCode) +
(createdAt.hashCode) +
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
(shared.hashCode) +
(sharedUsers.hashCode) +
(assets.hashCode);
@override
String toString() =>
'AlbumResponseDto[assetCount=$assetCount, id=$id, ownerId=$ownerId, albumName=$albumName, createdAt=$createdAt, albumThumbnailAssetId=$albumThumbnailAssetId, shared=$shared, sharedUsers=$sharedUsers, assets=$assets]';
String toString() => 'AlbumResponseDto[assetCount=$assetCount, id=$id, ownerId=$ownerId, albumName=$albumName, createdAt=$createdAt, albumThumbnailAssetId=$albumThumbnailAssetId, shared=$shared, sharedUsers=$sharedUsers, assets=$assets]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'assetCount'] = assetCount;
_json[r'id'] = id;
_json[r'ownerId'] = ownerId;
_json[r'albumName'] = albumName;
_json[r'createdAt'] = createdAt;
_json[r'assetCount'] = assetCount;
_json[r'id'] = id;
_json[r'ownerId'] = ownerId;
_json[r'albumName'] = albumName;
_json[r'createdAt'] = createdAt;
if (albumThumbnailAssetId != null) {
_json[r'albumThumbnailAssetId'] = albumThumbnailAssetId;
} else {
_json[r'albumThumbnailAssetId'] = null;
}
_json[r'shared'] = shared;
_json[r'sharedUsers'] = sharedUsers;
_json[r'assets'] = assets;
_json[r'shared'] = shared;
_json[r'sharedUsers'] = sharedUsers;
_json[r'assets'] = assets;
return _json;
}
@@ -101,13 +98,13 @@ class AlbumResponseDto {
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
// assert(() {
// requiredKeys.forEach((key) {
// assert(json.containsKey(key), 'Required key "AlbumResponseDto[$key]" is missing from JSON.');
// assert(json[key] != null, 'Required key "AlbumResponseDto[$key]" has a null value in JSON.');
// });
// return true;
// }());
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AlbumResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AlbumResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AlbumResponseDto(
assetCount: mapValueOfType<int>(json, r'assetCount')!,
@@ -115,8 +112,7 @@ class AlbumResponseDto {
ownerId: mapValueOfType<String>(json, r'ownerId')!,
albumName: mapValueOfType<String>(json, r'albumName')!,
createdAt: mapValueOfType<String>(json, r'createdAt')!,
albumThumbnailAssetId:
mapValueOfType<String>(json, r'albumThumbnailAssetId'),
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
shared: mapValueOfType<bool>(json, r'shared')!,
sharedUsers: UserResponseDto.listFromJson(json[r'sharedUsers'])!,
assets: AssetResponseDto.listFromJson(json[r'assets'])!,
@@ -125,10 +121,7 @@ class AlbumResponseDto {
return null;
}
static List<AlbumResponseDto>? listFromJson(
dynamic json, {
bool growable = false,
}) {
static List<AlbumResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -156,18 +149,12 @@ class AlbumResponseDto {
}
// maps a json object with a list of AlbumResponseDto-objects as value to a dart map
static Map<String, List<AlbumResponseDto>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
static Map<String, List<AlbumResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumResponseDto.listFromJson(
entry.value,
growable: growable,
);
final value = AlbumResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
@@ -189,3 +176,4 @@ class AlbumResponseDto {
'assets',
};
}

View File

@@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AssetCountByTimeGroupDto {
/// Returns a new [AssetCountByTimeGroupDto] instance.
AssetCountByTimeGroupDto({
required this.timeGroup,
required this.count,
});
String timeGroup;
int count;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountByTimeGroupDto &&
other.timeGroup == timeGroup &&
other.count == count;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(timeGroup.hashCode) +
(count.hashCode);
@override
String toString() => 'AssetCountByTimeGroupDto[timeGroup=$timeGroup, count=$count]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'timeGroup'] = timeGroup;
_json[r'count'] = count;
return _json;
}
/// Returns a new [AssetCountByTimeGroupDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountByTimeGroupDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountByTimeGroupDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountByTimeGroupDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountByTimeGroupDto(
timeGroup: mapValueOfType<String>(json, r'timeGroup')!,
count: mapValueOfType<int>(json, r'count')!,
);
}
return null;
}
static List<AssetCountByTimeGroupDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountByTimeGroupDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountByTimeGroupDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountByTimeGroupDto> mapFromJson(dynamic json) {
final map = <String, AssetCountByTimeGroupDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountByTimeGroupDto-objects as value to a dart map
static Map<String, List<AssetCountByTimeGroupDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountByTimeGroupDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'timeGroup',
'count',
};
}

View File

@@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AssetCountByTimeGroupResponseDto {
/// Returns a new [AssetCountByTimeGroupResponseDto] instance.
AssetCountByTimeGroupResponseDto({
required this.count,
this.buckets = const [],
});
int count;
List<AssetCountByTimeBucketResponseDto> buckets;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountByTimeGroupResponseDto &&
other.count == count &&
other.buckets == buckets;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(count.hashCode) +
(buckets.hashCode);
@override
String toString() => 'AssetCountByTimeGroupResponseDto[count=$count, buckets=$buckets]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'count'] = count;
_json[r'buckets'] = buckets;
return _json;
}
/// Returns a new [AssetCountByTimeGroupResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountByTimeGroupResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountByTimeGroupResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountByTimeGroupResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountByTimeGroupResponseDto(
count: mapValueOfType<int>(json, r'count')!,
buckets: AssetCountByTimeBucketResponseDto.listFromJson(json[r'buckets'])!,
);
}
return null;
}
static List<AssetCountByTimeGroupResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountByTimeGroupResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountByTimeGroupResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountByTimeGroupResponseDto> mapFromJson(dynamic json) {
final map = <String, AssetCountByTimeGroupResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountByTimeGroupResponseDto-objects as value to a dart map
static Map<String, List<AssetCountByTimeGroupResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountByTimeGroupResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'count',
'buckets',
};
}

View File

@@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AssetCountResponseDto {
/// Returns a new [AssetCountResponseDto] instance.
AssetCountResponseDto({
required this.photos,
required this.videos,
});
int photos;
int videos;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountResponseDto &&
other.photos == photos &&
other.videos == videos;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(photos.hashCode) +
(videos.hashCode);
@override
String toString() => 'AssetCountResponseDto[photos=$photos, videos=$videos]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'photos'] = photos;
_json[r'videos'] = videos;
return _json;
}
/// Returns a new [AssetCountResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountResponseDto(
photos: mapValueOfType<int>(json, r'photos')!,
videos: mapValueOfType<int>(json, r'videos')!,
);
}
return null;
}
static List<AssetCountResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountResponseDto> mapFromJson(dynamic json) {
final map = <String, AssetCountResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountResponseDto-objects as value to a dart map
static Map<String, List<AssetCountResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'photos',
'videos',
};
}

View File

@@ -30,6 +30,7 @@ class AssetResponseDto {
this.exifInfo,
this.smartInfo,
this.livePhotoVideoId,
this.tags = const [],
});
AssetTypeEnum type;
@@ -78,6 +79,8 @@ class AssetResponseDto {
String? livePhotoVideoId;
List<TagResponseDto> tags;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto &&
other.type == type &&
@@ -96,7 +99,8 @@ class AssetResponseDto {
other.encodedVideoPath == encodedVideoPath &&
other.exifInfo == exifInfo &&
other.smartInfo == smartInfo &&
other.livePhotoVideoId == livePhotoVideoId;
other.livePhotoVideoId == livePhotoVideoId &&
other.tags == tags;
@override
int get hashCode =>
@@ -117,10 +121,11 @@ class AssetResponseDto {
(encodedVideoPath == null ? 0 : encodedVideoPath!.hashCode) +
(exifInfo == null ? 0 : exifInfo!.hashCode) +
(smartInfo == null ? 0 : smartInfo!.hashCode) +
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode);
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) +
(tags.hashCode);
@override
String toString() => 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo, livePhotoVideoId=$livePhotoVideoId]';
String toString() => 'AssetResponseDto[type=$type, id=$id, deviceAssetId=$deviceAssetId, ownerId=$ownerId, deviceId=$deviceId, originalPath=$originalPath, resizePath=$resizePath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, duration=$duration, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, exifInfo=$exifInfo, smartInfo=$smartInfo, livePhotoVideoId=$livePhotoVideoId, tags=$tags]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
@@ -169,6 +174,7 @@ class AssetResponseDto {
} else {
_json[r'livePhotoVideoId'] = null;
}
_json[r'tags'] = tags;
return _json;
}
@@ -208,6 +214,7 @@ class AssetResponseDto {
exifInfo: ExifResponseDto.fromJson(json[r'exifInfo']),
smartInfo: SmartInfoResponseDto.fromJson(json[r'smartInfo']),
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
tags: TagResponseDto.listFromJson(json[r'tags'])!,
);
}
return null;
@@ -270,6 +277,7 @@ class AssetResponseDto {
'mimeType',
'duration',
'webpPath',
'tags',
};
}

View File

@@ -10,36 +10,42 @@
part of openapi.api;
class CreateJobDto {
/// Returns a new [CreateJobDto] instance.
CreateJobDto({
required this.jobType,
class CreateTagDto {
/// Returns a new [CreateTagDto] instance.
CreateTagDto({
required this.type,
required this.name,
});
JobType jobType;
TagTypeEnum type;
String name;
@override
bool operator ==(Object other) => identical(this, other) || other is CreateJobDto &&
other.jobType == jobType;
bool operator ==(Object other) => identical(this, other) || other is CreateTagDto &&
other.type == type &&
other.name == name;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(jobType.hashCode);
(type.hashCode) +
(name.hashCode);
@override
String toString() => 'CreateJobDto[jobType=$jobType]';
String toString() => 'CreateTagDto[type=$type, name=$name]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'jobType'] = jobType;
_json[r'type'] = type;
_json[r'name'] = name;
return _json;
}
/// Returns a new [CreateJobDto] instance and imports its values from
/// Returns a new [CreateTagDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CreateJobDto? fromJson(dynamic value) {
static CreateTagDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
@@ -48,24 +54,25 @@ class CreateJobDto {
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "CreateJobDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CreateJobDto[$key]" has a null value in JSON.');
assert(json.containsKey(key), 'Required key "CreateTagDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CreateTagDto[$key]" has a null value in JSON.');
});
return true;
}());
return CreateJobDto(
jobType: JobType.fromJson(json[r'jobType'])!,
return CreateTagDto(
type: TagTypeEnum.fromJson(json[r'type'])!,
name: mapValueOfType<String>(json, r'name')!,
);
}
return null;
}
static List<CreateJobDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <CreateJobDto>[];
static List<CreateTagDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <CreateTagDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CreateJobDto.fromJson(row);
final value = CreateTagDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -74,12 +81,12 @@ class CreateJobDto {
return result.toList(growable: growable);
}
static Map<String, CreateJobDto> mapFromJson(dynamic json) {
final map = <String, CreateJobDto>{};
static Map<String, CreateTagDto> mapFromJson(dynamic json) {
final map = <String, CreateTagDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateJobDto.fromJson(entry.value);
final value = CreateTagDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -88,13 +95,13 @@ class CreateJobDto {
return map;
}
// maps a json object with a list of CreateJobDto-objects as value to a dart map
static Map<String, List<CreateJobDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CreateJobDto>>{};
// maps a json object with a list of CreateTagDto-objects as value to a dart map
static Map<String, List<CreateTagDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CreateTagDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateJobDto.listFromJson(entry.value, growable: growable,);
final value = CreateTagDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
@@ -105,7 +112,8 @@ class CreateJobDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'jobType',
'type',
'name',
};
}

View File

@@ -1,111 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class GetAssetCountByTimeGroupDto {
/// Returns a new [GetAssetCountByTimeGroupDto] instance.
GetAssetCountByTimeGroupDto({
required this.timeGroup,
});
TimeGroupEnum timeGroup;
@override
bool operator ==(Object other) => identical(this, other) || other is GetAssetCountByTimeGroupDto &&
other.timeGroup == timeGroup;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(timeGroup.hashCode);
@override
String toString() => 'GetAssetCountByTimeGroupDto[timeGroup=$timeGroup]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'timeGroup'] = timeGroup;
return _json;
}
/// Returns a new [GetAssetCountByTimeGroupDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static GetAssetCountByTimeGroupDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "GetAssetCountByTimeGroupDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "GetAssetCountByTimeGroupDto[$key]" has a null value in JSON.');
});
return true;
}());
return GetAssetCountByTimeGroupDto(
timeGroup: TimeGroupEnum.fromJson(json[r'timeGroup'])!,
);
}
return null;
}
static List<GetAssetCountByTimeGroupDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <GetAssetCountByTimeGroupDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = GetAssetCountByTimeGroupDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, GetAssetCountByTimeGroupDto> mapFromJson(dynamic json) {
final map = <String, GetAssetCountByTimeGroupDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GetAssetCountByTimeGroupDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of GetAssetCountByTimeGroupDto-objects as value to a dart map
static Map<String, List<GetAssetCountByTimeGroupDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<GetAssetCountByTimeGroupDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GetAssetCountByTimeGroupDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'timeGroup',
};
}

View File

@@ -1,91 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class JobType {
/// Instantiate a new enum with the provided [value].
const JobType._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const THUMBNAIL_GENERATION = JobType._(r'THUMBNAIL_GENERATION');
static const METADATA_EXTRACTION = JobType._(r'METADATA_EXTRACTION');
static const VIDEO_CONVERSION = JobType._(r'VIDEO_CONVERSION');
static const CHECKSUM_GENERATION = JobType._(r'CHECKSUM_GENERATION');
/// List of all possible values in this [enum][JobType].
static const values = <JobType>[
THUMBNAIL_GENERATION,
METADATA_EXTRACTION,
VIDEO_CONVERSION,
CHECKSUM_GENERATION,
];
static JobType? fromJson(dynamic value) => JobTypeTypeTransformer().decode(value);
static List<JobType>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <JobType>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = JobType.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [JobType] to String,
/// and [decode] dynamic data back to [JobType].
class JobTypeTypeTransformer {
factory JobTypeTypeTransformer() => _instance ??= const JobTypeTypeTransformer._();
const JobTypeTypeTransformer._();
String encode(JobType data) => data.value;
/// Decodes a [dynamic value][data] to a JobType.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
JobType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'THUMBNAIL_GENERATION': return JobType.THUMBNAIL_GENERATION;
case r'METADATA_EXTRACTION': return JobType.METADATA_EXTRACTION;
case r'VIDEO_CONVERSION': return JobType.VIDEO_CONVERSION;
case r'CHECKSUM_GENERATION': return JobType.CHECKSUM_GENERATION;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [JobTypeTypeTransformer] instance.
static JobTypeTypeTransformer? _instance;
}

View File

@@ -10,36 +10,42 @@
part of openapi.api;
class SystemConfigResponseDto {
/// Returns a new [SystemConfigResponseDto] instance.
SystemConfigResponseDto({
this.config = const [],
class SystemConfigDto {
/// Returns a new [SystemConfigDto] instance.
SystemConfigDto({
required this.ffmpeg,
required this.oauth,
});
List<SystemConfigResponseItem> config;
SystemConfigFFmpegDto ffmpeg;
SystemConfigOAuthDto oauth;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigResponseDto &&
other.config == config;
bool operator ==(Object other) => identical(this, other) || other is SystemConfigDto &&
other.ffmpeg == ffmpeg &&
other.oauth == oauth;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(config.hashCode);
(ffmpeg.hashCode) +
(oauth.hashCode);
@override
String toString() => 'SystemConfigResponseDto[config=$config]';
String toString() => 'SystemConfigDto[ffmpeg=$ffmpeg, oauth=$oauth]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'config'] = config;
_json[r'ffmpeg'] = ffmpeg;
_json[r'oauth'] = oauth;
return _json;
}
/// Returns a new [SystemConfigResponseDto] instance and imports its values from
/// Returns a new [SystemConfigDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigResponseDto? fromJson(dynamic value) {
static SystemConfigDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
@@ -48,24 +54,25 @@ class SystemConfigResponseDto {
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "SystemConfigResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "SystemConfigResponseDto[$key]" has a null value in JSON.');
assert(json.containsKey(key), 'Required key "SystemConfigDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "SystemConfigDto[$key]" has a null value in JSON.');
});
return true;
}());
return SystemConfigResponseDto(
config: SystemConfigResponseItem.listFromJson(json[r'config'])!,
return SystemConfigDto(
ffmpeg: SystemConfigFFmpegDto.fromJson(json[r'ffmpeg'])!,
oauth: SystemConfigOAuthDto.fromJson(json[r'oauth'])!,
);
}
return null;
}
static List<SystemConfigResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigResponseDto>[];
static List<SystemConfigDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigResponseDto.fromJson(row);
final value = SystemConfigDto.fromJson(row);
if (value != null) {
result.add(value);
}
@@ -74,12 +81,12 @@ class SystemConfigResponseDto {
return result.toList(growable: growable);
}
static Map<String, SystemConfigResponseDto> mapFromJson(dynamic json) {
final map = <String, SystemConfigResponseDto>{};
static Map<String, SystemConfigDto> mapFromJson(dynamic json) {
final map = <String, SystemConfigDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigResponseDto.fromJson(entry.value);
final value = SystemConfigDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
@@ -88,13 +95,13 @@ class SystemConfigResponseDto {
return map;
}
// maps a json object with a list of SystemConfigResponseDto-objects as value to a dart map
static Map<String, List<SystemConfigResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigResponseDto>>{};
// maps a json object with a list of SystemConfigDto-objects as value to a dart map
static Map<String, List<SystemConfigDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigResponseDto.listFromJson(entry.value, growable: growable,);
final value = SystemConfigDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
@@ -105,7 +112,8 @@ class SystemConfigResponseDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'config',
'ffmpeg',
'oauth',
};
}

View File

@@ -1,202 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemConfigEntity {
/// Returns a new [SystemConfigEntity] instance.
SystemConfigEntity({
required this.key,
required this.value,
});
SystemConfigEntityKeyEnum key;
Object value;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigEntity &&
other.key == key &&
other.value == value;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(key.hashCode) +
(value.hashCode);
@override
String toString() => 'SystemConfigEntity[key=$key, value=$value]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'key'] = key;
_json[r'value'] = value;
return _json;
}
/// Returns a new [SystemConfigEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "SystemConfigEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "SystemConfigEntity[$key]" has a null value in JSON.');
});
return true;
}());
return SystemConfigEntity(
key: SystemConfigEntityKeyEnum.fromJson(json[r'key'])!,
value: mapValueOfType<Object>(json, r'value')!,
);
}
return null;
}
static List<SystemConfigEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SystemConfigEntity> mapFromJson(dynamic json) {
final map = <String, SystemConfigEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SystemConfigEntity-objects as value to a dart map
static Map<String, List<SystemConfigEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'key',
'value',
};
}
class SystemConfigEntityKeyEnum {
/// Instantiate a new enum with the provided [value].
const SystemConfigEntityKeyEnum._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const crf = SystemConfigEntityKeyEnum._(r'ffmpeg_crf');
static const preset = SystemConfigEntityKeyEnum._(r'ffmpeg_preset');
static const targetVideoCodec = SystemConfigEntityKeyEnum._(r'ffmpeg_target_video_codec');
static const targetAudioCodec = SystemConfigEntityKeyEnum._(r'ffmpeg_target_audio_codec');
static const targetScaling = SystemConfigEntityKeyEnum._(r'ffmpeg_target_scaling');
/// List of all possible values in this [enum][SystemConfigEntityKeyEnum].
static const values = <SystemConfigEntityKeyEnum>[
crf,
preset,
targetVideoCodec,
targetAudioCodec,
targetScaling,
];
static SystemConfigEntityKeyEnum? fromJson(dynamic value) => SystemConfigEntityKeyEnumTypeTransformer().decode(value);
static List<SystemConfigEntityKeyEnum>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigEntityKeyEnum>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigEntityKeyEnum.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [SystemConfigEntityKeyEnum] to String,
/// and [decode] dynamic data back to [SystemConfigEntityKeyEnum].
class SystemConfigEntityKeyEnumTypeTransformer {
factory SystemConfigEntityKeyEnumTypeTransformer() => _instance ??= const SystemConfigEntityKeyEnumTypeTransformer._();
const SystemConfigEntityKeyEnumTypeTransformer._();
String encode(SystemConfigEntityKeyEnum data) => data.value;
/// Decodes a [dynamic value][data] to a SystemConfigEntityKeyEnum.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
SystemConfigEntityKeyEnum? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'ffmpeg_crf': return SystemConfigEntityKeyEnum.crf;
case r'ffmpeg_preset': return SystemConfigEntityKeyEnum.preset;
case r'ffmpeg_target_video_codec': return SystemConfigEntityKeyEnum.targetVideoCodec;
case r'ffmpeg_target_audio_codec': return SystemConfigEntityKeyEnum.targetAudioCodec;
case r'ffmpeg_target_scaling': return SystemConfigEntityKeyEnum.targetScaling;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [SystemConfigEntityKeyEnumTypeTransformer] instance.
static SystemConfigEntityKeyEnumTypeTransformer? _instance;
}

Some files were not shown because too many files have changed in this diff Show More