瀏覽代碼

Merge branch 'main' into memories_widget

Neeraj Gupta 2 年之前
父節點
當前提交
27c86d6e15

+ 1 - 0
fastlane/metadata/android/es/short_description.txt

@@ -0,0 +1 @@
+ente es una aplicación de almacenamiento de fotos cifrado de extremo a extremo

+ 1 - 0
fastlane/metadata/android/es/title.txt

@@ -0,0 +1 @@
+ente - almacenamiento de fotos encriptado

+ 7 - 2
lib/db/files_db.dart

@@ -770,12 +770,17 @@ class FilesDB {
     return uploadedFileIDs;
   }
 
-  Future<File?> getUploadedFileInAnyCollection(int uploadedFileID) async {
+  Future<File?> getUploadedLocalFileInAnyCollection(
+    int uploadedFileID,
+    int userID,
+  ) async {
     final db = await instance.database;
     final results = await db.query(
       filesTable,
-      where: '$columnUploadedFileID = ?',
+      where: '$columnLocalID IS NOT NULL AND $columnOwnerID = ? AND '
+          '$columnUploadedFileID = ?',
       whereArgs: [
+        userID,
         uploadedFileID,
       ],
       limit: 1,

+ 7 - 0
lib/generated/intl/messages_es.dart

@@ -27,6 +27,9 @@ class MessageLookup extends MessageLookupByLibrary {
 
   static String m44(albumName) => "Añadido exitosamente a  ${albumName}";
 
+  static String m45(count) =>
+      "${Intl.plural(count, zero: 'No hay Participantes', one: '1 Participante', other: '${count} Participantes')}";
+
   static String m0(paymentProvider) =>
       "Por favor, cancele primero su suscripción existente de ${paymentProvider}";
 
@@ -221,6 +224,7 @@ class MessageLookup extends MessageLookupByLibrary {
             MessageLookupByLibrary.simpleMessage("Después de una semana"),
         "after1Year": MessageLookupByLibrary.simpleMessage("Después de un año"),
         "albumOwner": MessageLookupByLibrary.simpleMessage("Propietario"),
+        "albumParticipantsCount": m45,
         "albumTitle": MessageLookupByLibrary.simpleMessage("Título del álbum"),
         "albumUpdated":
             MessageLookupByLibrary.simpleMessage("Álbum actualizado"),
@@ -420,6 +424,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "currentUsageIs":
             MessageLookupByLibrary.simpleMessage("El uso actual es "),
         "custom": MessageLookupByLibrary.simpleMessage("Personalizado"),
+        "customRadius":
+            MessageLookupByLibrary.simpleMessage("Radio personalizado"),
         "darkTheme": MessageLookupByLibrary.simpleMessage("Oscuro"),
         "decrypting": MessageLookupByLibrary.simpleMessage("Descifrando..."),
         "decryptingVideo":
@@ -498,6 +504,7 @@ class MessageLookup extends MessageLookupByLibrary {
                 "Deshabilitando la autenticación de dos factores..."),
         "discord": MessageLookupByLibrary.simpleMessage("Discord"),
         "dismiss": MessageLookupByLibrary.simpleMessage("Descartar"),
+        "distanceInKMUnit": MessageLookupByLibrary.simpleMessage("km"),
         "doThisLater":
             MessageLookupByLibrary.simpleMessage("Hacer esto más tarde"),
         "doYouWantToDiscardTheEditsYouHaveMade":

+ 19 - 1
lib/l10n/intl_es.arb

@@ -219,6 +219,16 @@
   "after1Month": "Después de un mes",
   "after1Year": "Después de un año",
   "manageParticipants": "Administrar",
+  "albumParticipantsCount": "{count, plural, =0 {No hay Participantes} =1 {1 Participante} other {{count} Participantes}}",
+  "@albumParticipantsCount": {
+    "placeholders": {
+      "count": {
+        "type": "int",
+        "example": "5"
+      }
+    },
+    "description": "Number of participants in an album, including the album owner."
+  },
   "collabLinkSectionDescription": "Crea un enlace para que la gente pueda añadir y ver fotos en tu álbum compartido sin necesidad de la aplicación ente o una cuenta. Genial para recolectar fotos de eventos.",
   "collectPhotos": "Recolectar fotos",
   "collaborativeLink": "Enlace colaborativo",
@@ -929,5 +939,13 @@
   "doYouWantToDiscardTheEditsYouHaveMade": "¿Quieres descartar las ediciones que has hecho?",
   "saving": "Saving...",
   "editsSaved": "Ediciones guardadas",
-  "oopsCouldNotSaveEdits": "Ups, no se pudieron guardar las ediciónes"
+  "oopsCouldNotSaveEdits": "Ups, no se pudieron guardar las ediciónes",
+  "customRadius": "Radio personalizado",
+  "@customRadius": {
+    "description": "Custom radius for location tag"
+  },
+  "distanceInKMUnit": "km",
+  "@distanceInKMUnit": {
+    "description": "Unit for distance in km"
+  }
 }

+ 4 - 1
lib/services/remote_sync_service.dart

@@ -519,7 +519,10 @@ class RemoteSyncService {
             .info("Skipping some updated files as we are throttling uploads");
         break;
       }
-      final file = await _db.getUploadedFileInAnyCollection(uploadedFileID);
+      final file = await _db.getUploadedLocalFileInAnyCollection(
+        uploadedFileID,
+        ownerID,
+      );
       if (file != null) {
         _uploadFile(file, file.collectionID!, futures);
       }

+ 4 - 1
lib/ui/home/memories/memories_widget.dart

@@ -34,7 +34,10 @@ class MemoriesWidget extends StatelessWidget {
     }
     return SingleChildScrollView(
       scrollDirection: Axis.horizontal,
-      child: Row(children: memoryWidgets),
+      child: Row(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        children: memoryWidgets,
+      ),
     );
   }
 

+ 23 - 21
lib/ui/home/memories/memory_cover_widget.dart

@@ -32,30 +32,32 @@ class _MemoryCovertWidgetState extends State<MemoryCovertWidget> {
         );
         setState(() {});
       },
-      child: SizedBox(
-        height: 100,
-        width: 92,
-        child: Padding(
-          padding: const EdgeInsets.all(8.0),
-          child: Column(
-            children: [
-              _buildMemoryItem(context, index),
-              const Padding(padding: EdgeInsets.all(4)),
-              Hero(
-                tag: title,
-                child: Material(
-                  type: MaterialType.transparency,
-                  child: Text(
-                    title,
-                    overflow: TextOverflow.ellipsis,
-                    style: getEnteTextTheme(context).mini,
-                    textAlign: TextAlign.center,
+      child: Row(
+        children: [
+          Padding(
+            padding: const EdgeInsets.all(8.0),
+            child: Column(
+              children: [
+                _buildMemoryItem(context, index),
+                const Padding(padding: EdgeInsets.all(4)),
+                Hero(
+                  tag: title,
+                  child: Material(
+                    type: MaterialType.transparency,
+                    child: ConstrainedBox(
+                      constraints: const BoxConstraints(maxWidth: 84),
+                      child: Text(
+                        title,
+                        style: getEnteTextTheme(context).mini,
+                        textAlign: TextAlign.center,
+                      ),
+                    ),
                   ),
                 ),
-              ),
-            ],
+              ],
+            ),
           ),
-        ),
+        ],
       ),
     );
   }

+ 5 - 7
lib/ui/home/status_bar_widget.dart

@@ -91,13 +91,11 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
                   : const SyncStatusWidget()
               : const Text("ente", style: brandStyleMedium),
         ),
-        AnimatedOpacity(
-          opacity: _showErrorBanner ? 1 : 0,
-          duration: const Duration(milliseconds: 200),
-          child: const Divider(
-            height: 8,
-          ),
-        ),
+        _showErrorBanner
+            ? const Divider(
+                height: 8,
+              )
+            : const SizedBox.shrink(),
         _showErrorBanner
             ? HeaderErrorWidget(error: _syncError)
             : const SizedBox.shrink(),

+ 1 - 0
lib/ui/viewer/file/zoomable_image.dart

@@ -278,6 +278,7 @@ class _ZoomableImageState extends State<ZoomableImage>
           w != 0 &&
           (h != widget.photo.height || w != widget.photo.width)) {
         _logger.info('Updating aspect ratio for ${widget.photo} to $h:$w');
+
         await FileMagicService.instance.updatePublicMagicMetadata([
           widget.photo
         ], {

+ 3 - 0
lib/utils/file_uploader.dart

@@ -117,6 +117,9 @@ class FileUploader {
   // upload future will return null as File when the file entry is deleted
   // locally because it's already present in the destination collection.
   Future<File> upload(File file, int collectionID) {
+    if (file.localID == null || file.localID!.isEmpty) {
+      return Future.error(Exception("file's localID can not be null or empty"));
+    }
     // If the file hasn't been queued yet, queue it
     _totalCountInUploadSession++;
     if (!_queue.containsKey(file.localID)) {