various fixes

This commit is contained in:
Thibault Deckers 2022-01-10 19:26:18 +09:00
parent f6da334197
commit abed48e758
6 changed files with 21 additions and 7 deletions

View file

@ -272,7 +272,9 @@ object StorageUtils {
// content://com.android.externalstorage.documents/tree/primary%3A -> /storage/emulated/0/ // content://com.android.externalstorage.documents/tree/primary%3A -> /storage/emulated/0/
// content://com.android.externalstorage.documents/tree/10F9-3F13%3APictures -> /storage/10F9-3F13/Pictures/ // content://com.android.externalstorage.documents/tree/10F9-3F13%3APictures -> /storage/10F9-3F13/Pictures/
fun convertTreeUriToDirPath(context: Context, treeUri: Uri): String? { fun convertTreeUriToDirPath(context: Context, treeUri: Uri): String? {
val encoded = treeUri.toString().substring(TREE_URI_ROOT.length) val treeUriString = treeUri.toString()
if (treeUriString.length <= TREE_URI_ROOT.length) return null
val encoded = treeUriString.substring(TREE_URI_ROOT.length)
val matcher = TREE_URI_PATH_PATTERN.matcher(Uri.decode(encoded)) val matcher = TREE_URI_PATH_PATTERN.matcher(Uri.decode(encoded))
with(matcher) { with(matcher) {
if (find()) { if (find()) {

View file

@ -21,12 +21,12 @@ import 'package:flutter/widgets.dart';
abstract class CollectionFilter extends Equatable implements Comparable<CollectionFilter> { abstract class CollectionFilter extends Equatable implements Comparable<CollectionFilter> {
static const List<String> categoryOrder = [ static const List<String> categoryOrder = [
QueryFilter.type, QueryFilter.type,
FavouriteFilter.type,
MimeFilter.type, MimeFilter.type,
TypeFilter.type,
AlbumFilter.type, AlbumFilter.type,
TypeFilter.type,
LocationFilter.type, LocationFilter.type,
CoordinateFilter.type, CoordinateFilter.type,
FavouriteFilter.type,
RatingFilter.type, RatingFilter.type,
TagFilter.type, TagFilter.type,
PathFilter.type, PathFilter.type,

View file

@ -1,9 +1,10 @@
import 'package:aves/model/metadata/enums.dart'; import 'package:aves/model/metadata/enums.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
@immutable @immutable
class DateModifier { class DateModifier extends Equatable {
static const writableDateFields = [ static const writableDateFields = [
MetadataField.exifDate, MetadataField.exifDate,
MetadataField.exifDateOriginal, MetadataField.exifDateOriginal,
@ -18,6 +19,9 @@ class DateModifier {
final DateFieldSource? copyFieldSource; final DateFieldSource? copyFieldSource;
final int? shiftMinutes; final int? shiftMinutes;
@override
List<Object?> get props => [action, fields, setDateTime, copyFieldSource, shiftMinutes];
const DateModifier._private( const DateModifier._private(
this.action, this.action,
this.fields, { this.fields, {

View file

@ -162,6 +162,6 @@ class _BugReportState extends State<BugReport> with FeedbackMixin {
} }
Future<void> _goToGithub() async { Future<void> _goToGithub() async {
await launch('${Constants.avesGithub}/issues/new'); await launch('${Constants.avesGithub}/issues/new?labels=type%3Abug&template=bug_report.md');
} }
} }

View file

@ -95,7 +95,7 @@ class _EditEntryDateDialogState extends State<EditEntryDateDialog> {
if (_action == DateEditAction.setCustom) _buildSetCustomContent(context), if (_action == DateEditAction.setCustom) _buildSetCustomContent(context),
if (_action == DateEditAction.copyField) _buildCopyFieldContent(context), if (_action == DateEditAction.copyField) _buildCopyFieldContent(context),
if (_action == DateEditAction.shift) _buildShiftContent(context), if (_action == DateEditAction.shift) _buildShiftContent(context),
(_action == DateEditAction.shift || _action == DateEditAction.remove)? _buildDestinationFields(context): const SizedBox(height: 8), (_action == DateEditAction.shift || _action == DateEditAction.remove) ? _buildDestinationFields(context) : const SizedBox(height: 8),
], ],
), ),
), ),

View file

@ -11,6 +11,7 @@ class XmpCrsNamespace extends XmpNamespace {
static final pbcPattern = RegExp(ns + r':PaintBasedCorrections\[(\d+)\]/(.*)'); static final pbcPattern = RegExp(ns + r':PaintBasedCorrections\[(\d+)\]/(.*)');
static final retouchAreasPattern = RegExp(ns + r':RetouchAreas\[(\d+)\]/(.*)'); static final retouchAreasPattern = RegExp(ns + r':RetouchAreas\[(\d+)\]/(.*)');
static final lookPattern = RegExp(ns + r':Look/(.*)'); static final lookPattern = RegExp(ns + r':Look/(.*)');
static final rmmiPattern = RegExp(ns + r':RangeMaskMapInfo/' + ns + r':RangeMaskMapInfo/(.*)');
final cgbc = <int, Map<String, String>>{}; final cgbc = <int, Map<String, String>>{};
final gbc = <int, Map<String, String>>{}; final gbc = <int, Map<String, String>>{};
@ -18,12 +19,14 @@ class XmpCrsNamespace extends XmpNamespace {
final pbc = <int, Map<String, String>>{}; final pbc = <int, Map<String, String>>{};
final retouchAreas = <int, Map<String, String>>{}; final retouchAreas = <int, Map<String, String>>{};
final look = <String, String>{}; final look = <String, String>{};
final rmmi = <String, String>{};
XmpCrsNamespace(Map<String, String> rawProps) : super(ns, rawProps); XmpCrsNamespace(Map<String, String> rawProps) : super(ns, rawProps);
@override @override
bool extractData(XmpProp prop) { bool extractData(XmpProp prop) {
final hasStructs = extractStruct(prop, lookPattern, look); var hasStructs = extractStruct(prop, lookPattern, look);
hasStructs |= extractStruct(prop, rmmiPattern, rmmi);
var hasIndexedStructs = extractIndexedStruct(prop, cgbcPattern, cgbc); var hasIndexedStructs = extractIndexedStruct(prop, cgbcPattern, cgbc);
hasIndexedStructs |= extractIndexedStruct(prop, gbcPattern, gbc); hasIndexedStructs |= extractIndexedStruct(prop, gbcPattern, gbc);
hasIndexedStructs |= extractIndexedStruct(prop, mgbcPattern, mgbc); hasIndexedStructs |= extractIndexedStruct(prop, mgbcPattern, mgbc);
@ -59,6 +62,11 @@ class XmpCrsNamespace extends XmpNamespace {
title: 'Paint Based Corrections', title: 'Paint Based Corrections',
structByIndex: pbc, structByIndex: pbc,
), ),
if (rmmi.isNotEmpty)
XmpStructCard(
title: 'Range Mask Map Info',
struct: rmmi,
),
if (retouchAreas.isNotEmpty) if (retouchAreas.isNotEmpty)
XmpStructArrayCard( XmpStructArrayCard(
title: 'Retouch Areas', title: 'Retouch Areas',