Compare commits

...

3 Commits

Author SHA1 Message Date
Alex Tran
1efcac0946 Pump Patch 2022-12-11 14:25:51 -06:00
Matthias Rupp
415550f16d fix(server): Allow access to assets in shared album owned by current user (#1094)
* fix(server): Allow access to assets in shared album owned by current user

* Fix sql query

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2022-12-11 14:24:06 -06:00
Alex
aa554a9e77 [Localizely] Translations update (#1091) 2022-12-11 06:53:40 -06:00
3 changed files with 29 additions and 25 deletions

View File

@@ -35,7 +35,7 @@
"backup_controller_page_background_battery_info_title": "Ottimizzazioni batteria",
"backup_controller_page_background_charging": "Solo durante la ricarica",
"backup_controller_page_background_configure_error": "Impossibile configurare i servizi in background",
"backup_controller_page_background_delay": "Delay new assets backup: {}",
"backup_controller_page_background_delay": "Ritarda il backup di nuovi elementi: {}",
"backup_controller_page_background_description": "Abilita i servizi in background per fare il backup di tutti i nuovi contenuti senza la necessità di aprire l'app",
"backup_controller_page_background_is_off": "Backup automatico disattivato",
"backup_controller_page_background_is_on": "Backup automatico attivo",
@@ -83,10 +83,10 @@
"cache_settings_subtitle": "Controlla il comportamento della cache dell'applicazione mobile immich",
"cache_settings_thumbnail_size": "Dimensione cache anteprime ({} assets)",
"cache_settings_title": "Impostazioni della Cache",
"control_bottom_app_bar_add_to_album": "Add to album",
"control_bottom_app_bar_album_info": "{} items",
"control_bottom_app_bar_album_info_shared": "{} items · Shared",
"control_bottom_app_bar_create_new_album": "Create new album",
"control_bottom_app_bar_add_to_album": "Aggiungi all'album",
"control_bottom_app_bar_album_info": "{} elementi",
"control_bottom_app_bar_album_info_shared": "{} elementi · Condivisi",
"control_bottom_app_bar_create_new_album": "Crea nuovo album",
"control_bottom_app_bar_delete": "Elimina",
"control_bottom_app_bar_share": "Condividi",
"create_album_page_untitled": "Senza titolo",
@@ -108,8 +108,8 @@
"experimental_settings_new_asset_list_title": "Attiva griglia di foto sperimentale",
"experimental_settings_subtitle": "Usalo a tuo rischio!",
"experimental_settings_title": "Sperimentale",
"home_page_add_to_album_conflicts": "Added {added} assets to album {album}. {failed} assets are already in the album.",
"home_page_add_to_album_success": "Added {added} assets to album {album}.",
"home_page_add_to_album_conflicts": "Aggiunti {added} elementi all'album {album}. {failed} elementi erano già presenti nell'album.",
"home_page_add_to_album_success": "Aggiunti {added} elementi all'album {album}",
"library_page_albums": "Album",
"library_page_new_album": "Nuovo Album",
"login_form_button_text": "Login",
@@ -120,8 +120,8 @@
"login_form_err_invalid_email": "Email non valida",
"login_form_err_leading_whitespace": "Whitespace all'inizio ",
"login_form_err_trailing_whitespace": "Whitespace alla fine",
"login_form_failed_get_oauth_server_config": "Error logging using OAuth, check server URL",
"login_form_failed_get_oauth_server_disable": "OAuth feature is not available on this server",
"login_form_failed_get_oauth_server_config": "Errore di login usando OAuth, controlla l'URL del server",
"login_form_failed_get_oauth_server_disable": "OAuth non è disponibile su questo server",
"login_form_failed_login": "Errore nel login, controlla URL del server e le credenziali (email e password)",
"login_form_label_email": "Email",
"login_form_label_password": "Password",
@@ -141,17 +141,17 @@
"select_additional_user_for_sharing_page_suggestions": "Suggerimenti ",
"select_user_for_sharing_page_err_album": "Impossibile nel creare l'album ",
"select_user_for_sharing_page_share_suggestions": "Suggerimenti",
"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_original_subtitle": "Enable to load the original full-resolution image (large!). Disable to reduce data usage (both network and on device cache).",
"setting_image_viewer_original_title": "Load original 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_preview_title": "Load preview image",
"setting_image_viewer_help": "Il visualizzatore dettagliato carica una piccola thumbnail per prima, per poi caricare un immagine di media grandezza (se abilitato). Ed infine carica l'originale (se abilitato).",
"setting_image_viewer_original_subtitle": "Abilita per caricare l'immagine originale a risoluzione massima (grande!). Disabilita per ridurre l'utilizzo di banda (sia sul network che nella cache del dispositivo).",
"setting_image_viewer_original_title": "Carica l'immagine originale",
"setting_image_viewer_preview_subtitle": "Abilita per caricare un'immagine a risoluzione media.\nDisabilita per caricare direttamente l'immagine originale o usare la thumbnail.",
"setting_image_viewer_preview_title": "Carica immagine di preview",
"setting_notifications_notify_failures_grace_period": "Notifica caricamenti falliti in background: {}",
"setting_notifications_notify_hours": "{} ore",
"setting_notifications_notify_immediately": "immediatamente",
"setting_notifications_notify_minutes": "{} minuti",
"setting_notifications_notify_never": "mai",
"setting_notifications_notify_seconds": "{} seconds",
"setting_notifications_notify_seconds": "{} secondi",
"setting_notifications_single_progress_subtitle": "Informazioni dettagliate sul caricamento dell'immagine",
"setting_notifications_single_progress_title": "Mostra dettagli del processo di backup in background",
"setting_notifications_subtitle": "Cambia le impostazioni di notifica",

View File

@@ -3,7 +3,7 @@ import { AssetAlbumEntity } from '@app/database/entities/asset-album.entity';
import { UserAlbumEntity } from '@app/database/entities/user-album.entity';
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { In, Repository, SelectQueryBuilder, DataSource } from 'typeorm';
import { In, Repository, SelectQueryBuilder, DataSource, Brackets } from 'typeorm';
import { AddAssetsDto } from './dto/add-assets.dto';
import { AddUsersDto } from './dto/add-users.dto';
import { CreateAlbumDto } from './dto/create-album.dto';
@@ -286,14 +286,18 @@ export class AlbumRepository implements IAlbumRepository {
}
async getSharedWithUserAlbumCount(userId: string, assetId: string): Promise<number> {
const result = await this
.userAlbumRepository
.createQueryBuilder('usa')
.select('count(aa)', 'count')
.innerJoin('asset_album', 'aa', 'aa.albumId = usa.albumId')
.where('aa.assetId = :assetId', { assetId })
.andWhere('usa.sharedUserId = :userId', { userId })
.getRawOne();
const result = await this.userAlbumRepository
.createQueryBuilder('usa')
.select('count(aa)', 'count')
.innerJoin('asset_album', 'aa', 'aa.albumId = usa.albumId')
.innerJoin('albums', 'a', 'a.id = usa.albumId')
.where('aa.assetId = :assetId', { assetId })
.andWhere(
new Brackets((qb) => {
qb.where('a.ownerId = :userId', { userId }).orWhere('usa.sharedUserId = :userId', { userId });
}),
)
.getRawOne();
return result.count;
}

View File

@@ -11,7 +11,7 @@ export interface IServerVersion {
export const serverVersion: IServerVersion = {
major: 1,
minor: 38,
patch: 0,
patch: 2,
build: 60,
};