Merge branch 'main'
This commit is contained in:
commit
806f57785c
20 changed files with 130 additions and 63 deletions
2
.flutter
2
.flutter
|
@ -1 +1 @@
|
|||
Subproject commit f72efea43c3013323d1b95cff571f3c1caa37583
|
||||
Subproject commit 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
|
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
## <a id="unreleased"></a>[Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Collection: support for Sony predictive capture as burst
|
||||
|
||||
### Changed
|
||||
|
||||
- upgraded Flutter to stable v3.7.12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Viewer: multi-page context update when removing burst entries
|
||||
|
||||
## <a id="v1.8.5"></a>[v1.8.5] - 2023-04-18
|
||||
|
||||
### Added
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:aves/model/entry/entry.dart';
|
||||
import 'package:aves/model/multipage.dart';
|
||||
import 'package:aves/ref/bursts.dart';
|
||||
import 'package:aves/ref/mime_types.dart';
|
||||
import 'package:aves/services/common/services.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
@ -17,15 +18,8 @@ extension ExtraAvesEntryMultipage on AvesEntry {
|
|||
bool get isMotionPhoto => (catalogMetadata?.isMotionPhoto ?? false) || _isMotionPhotoLegacy;
|
||||
|
||||
String? getBurstKey(List<String> patterns) {
|
||||
if (filenameWithoutExtension != null) {
|
||||
for (final pattern in patterns) {
|
||||
final match = RegExp(pattern).firstMatch(filenameWithoutExtension!);
|
||||
if (match != null) {
|
||||
return '$directory/${match.group(1)}';
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
final key = BurstPatterns.getKeyForName(filenameWithoutExtension, patterns);
|
||||
return key != null ? '$directory/$key' : null;
|
||||
}
|
||||
|
||||
Future<MultiPageInfo?> getMultiPageInfo() async {
|
||||
|
|
|
@ -309,6 +309,7 @@ class Settings extends ChangeNotifier {
|
|||
if (videoBackgroundMode == VideoBackgroundMode.pip && !device.supportPictureInPicture) {
|
||||
_set(videoBackgroundModeKey, null);
|
||||
}
|
||||
collectionBurstPatterns = collectionBurstPatterns.where(BurstPatterns.options.contains).toList();
|
||||
}
|
||||
|
||||
// app
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
class BurstPatterns {
|
||||
static const samsung = r'^(\d{8}_\d{6})_(\d+)$';
|
||||
static const sony = r'^DSC_\d+_BURST(\d{17})(_COVER)?$';
|
||||
static const _keyGroupName = 'key';
|
||||
|
||||
static const samsung = r'^(?<key>\d{8}_\d{6})_(\d+)$';
|
||||
static const sony = r'^DSC(PDC)?_\d+_BURST(?<key>\d{17})(_COVER)?$';
|
||||
|
||||
static final options = [
|
||||
BurstPatterns.samsung,
|
||||
|
@ -33,6 +35,22 @@ class BurstPatterns {
|
|||
_Manufacturers.samsung: samsung,
|
||||
_Manufacturers.sony: sony,
|
||||
};
|
||||
|
||||
static String? getKeyForName(String? filename, List<String> patterns) {
|
||||
if (filename != null) {
|
||||
for (final pattern in patterns) {
|
||||
final match = RegExp(pattern).firstMatch(filename);
|
||||
if (match != null) {
|
||||
if (match.groupNames.contains(_keyGroupName)) {
|
||||
return match.namedGroup(_keyGroupName);
|
||||
}
|
||||
// fallback to fetching group by index for backward compatibility
|
||||
return match.group(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// values as returned by `DeviceInfoPlugin().androidInfo`
|
||||
|
|
|
@ -697,7 +697,20 @@ class _EntryViewerStackState extends State<EntryViewerStack> with EntryViewContr
|
|||
|
||||
if (hasCollection) {
|
||||
final collectionEntries = collection!.sortedEntries;
|
||||
removedEntries.forEach(collectionEntries.remove);
|
||||
removedEntries.forEach((removedEntry) {
|
||||
// remove from collection
|
||||
if (collectionEntries.remove(removedEntry)) return;
|
||||
|
||||
// remove from burst
|
||||
final mainEntry = collectionEntries.firstWhereOrNull((entry) => entry.burstEntries?.contains(removedEntry) == true);
|
||||
if (mainEntry != null) {
|
||||
final multiPageController = context.read<MultiPageConductor>().getController(mainEntry);
|
||||
if (multiPageController != null) {
|
||||
mainEntry.burstEntries!.remove(removedEntry);
|
||||
multiPageController.reset();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (collectionEntries.isNotEmpty) {
|
||||
_onCollectionChanged();
|
||||
return;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:aves/model/entry/entry.dart';
|
||||
import 'package:aves/model/entry/extensions/multipage.dart';
|
||||
|
@ -23,13 +24,20 @@ class MultiPageController {
|
|||
set page(int? page) => pageNotifier.value = page;
|
||||
|
||||
MultiPageController(this.entry) {
|
||||
entry.getMultiPageInfo().then((value) {
|
||||
if (value == null || _disposed) return;
|
||||
pageNotifier.value = value.defaultPage?.index ?? 0;
|
||||
_info = value;
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset() => entry.getMultiPageInfo().then((info) {
|
||||
if (info == null || _disposed) return;
|
||||
final currentPage = pageNotifier.value;
|
||||
if (currentPage == null) {
|
||||
pageNotifier.value = info.defaultPage?.index ?? 0;
|
||||
} else {
|
||||
pageNotifier.value = min(currentPage, info.pageCount - 1);
|
||||
}
|
||||
_info = info;
|
||||
_infoStreamController.add(_info);
|
||||
});
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
_disposed = true;
|
||||
|
|
|
@ -105,10 +105,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.0"
|
||||
version: "0.18.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -2,7 +2,7 @@ group 'deckers.thibault.aves.aves_platform_meta'
|
|||
version '1.0-SNAPSHOT'
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.7.20'
|
||||
ext.kotlin_version = '1.8.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
|
@ -14,7 +14,7 @@ buildscript {
|
|||
}
|
||||
}
|
||||
|
||||
rootProject.allprojects {
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
|
|
|
@ -5,10 +5,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: _flutterfire_internals
|
||||
sha256: f175bc1414e4edf8c5b83372c98eeabecf8353f39c9da423c2cfdf1f1f508788
|
||||
sha256: "6a0ad72b2bcdb461749e40c01c478212a78db848dfcb2f10f2a461988bc5fb29"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -68,10 +68,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_core
|
||||
sha256: ed611fb8e67e43ecc7956f242cecca383d87cf71aace27287aa5dd4bdba4ac07
|
||||
sha256: "239e4ac688674a7e7b5476fd16b0d8e2b5a453d464f32091af3ce1df4ebb7316"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.0"
|
||||
version: "2.10.0"
|
||||
firebase_core_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -92,18 +92,18 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: firebase_crashlytics
|
||||
sha256: "42cf6a137eaae7e485e6cc9794336e8e518c506b691aa6e19ff918206c535bec"
|
||||
sha256: bfc662a87df622e7d95c360536a4999f06474f53eda5a219af9e29193d498529
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.1"
|
||||
firebase_crashlytics_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_crashlytics_platform_interface
|
||||
sha256: baa4c3d4af426d29800f0d80d165f31df4548985db151fd761346e07ed433d31
|
||||
sha256: b9c7b8498c877a2901ad323fc92c10f672be1597bc82d08f121f6228f321a7e0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.4.0"
|
||||
version: "3.4.1"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
|
|
|
@ -11,7 +11,9 @@ dependencies:
|
|||
aves_report:
|
||||
path: ../aves_report
|
||||
collection:
|
||||
firebase_core:
|
||||
# as of `firebase_core` v2.10.0, upgrading packages downgrades `firebase_core` et al.
|
||||
# so that the transitive `path` gets upgraded to v1.8.3
|
||||
firebase_core: ">=2.10.0"
|
||||
firebase_crashlytics:
|
||||
stack_trace:
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ group 'deckers.thibault.aves.aves_screen_state'
|
|||
version '1.0-SNAPSHOT'
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.7.20'
|
||||
ext.kotlin_version = '1.8.0'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
||||
|
|
|
@ -112,10 +112,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.0"
|
||||
version: "0.18.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -220,10 +220,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.0"
|
||||
version: "0.18.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -142,10 +142,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.0"
|
||||
version: "0.18.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -119,10 +119,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.0"
|
||||
version: "0.18.1"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
40
pubspec.lock
40
pubspec.lock
|
@ -13,10 +13,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: _flutterfire_internals
|
||||
sha256: f175bc1414e4edf8c5b83372c98eeabecf8353f39c9da423c2cfdf1f1f508788
|
||||
sha256: "6a0ad72b2bcdb461749e40c01c478212a78db848dfcb2f10f2a461988bc5fb29"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.1"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -333,7 +333,7 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: aves
|
||||
resolved-ref: "1ff8e6d82466939997c0e04a8e28b04f40641728"
|
||||
resolved-ref: c12d794ff60c7309358955d69c5ed55f9028b052
|
||||
url: "https://github.com/deckerst/fijkplayer.git"
|
||||
source: git
|
||||
version: "0.10.0"
|
||||
|
@ -349,10 +349,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: firebase_core
|
||||
sha256: ed611fb8e67e43ecc7956f242cecca383d87cf71aace27287aa5dd4bdba4ac07
|
||||
sha256: "239e4ac688674a7e7b5476fd16b0d8e2b5a453d464f32091af3ce1df4ebb7316"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.0"
|
||||
version: "2.10.0"
|
||||
firebase_core_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -373,34 +373,34 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: firebase_crashlytics
|
||||
sha256: "42cf6a137eaae7e485e6cc9794336e8e518c506b691aa6e19ff918206c535bec"
|
||||
sha256: bfc662a87df622e7d95c360536a4999f06474f53eda5a219af9e29193d498529
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0"
|
||||
version: "3.1.1"
|
||||
firebase_crashlytics_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: firebase_crashlytics_platform_interface
|
||||
sha256: baa4c3d4af426d29800f0d80d165f31df4548985db151fd761346e07ed433d31
|
||||
sha256: b9c7b8498c877a2901ad323fc92c10f672be1597bc82d08f121f6228f321a7e0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.4.0"
|
||||
version: "3.4.1"
|
||||
flex_color_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flex_color_picker
|
||||
sha256: f0e0db8e3e47435cfbe9aa15c71b898fa218be0fc4ae409e1e42d5d5266b2c90
|
||||
sha256: fc035dbef0975dd2650f9db1335c552e3b0ce87da4900b00f6b98cd6c78cbe42
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.0"
|
||||
version: "3.2.1"
|
||||
flex_seed_scheme:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: flex_seed_scheme
|
||||
sha256: "7058288ef97d348657ac95cea25d65a9aac181ca08387ede891fd7230ad7600f"
|
||||
sha256: b3678d82403c13dec2ee2721e078b26f14577712411b6aa981b0f4269df3fabb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.3"
|
||||
version: "1.2.4"
|
||||
floating:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -691,10 +691,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: local_auth_android
|
||||
sha256: "2ccfadbb6fbc63e6674ad58a350b06188829e62669d67a0c752c4e43cb88272a"
|
||||
sha256: "17ca331f0563be12609221391157cbceafc58f12887e41d0baf4b4fc1bf8f015"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.21"
|
||||
version: "1.0.23"
|
||||
local_auth_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -788,7 +788,7 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: aves
|
||||
resolved-ref: "0bf47932242dea4f93f51be0f6bfa3d9e5616c31"
|
||||
resolved-ref: "0e02b0521beadd2be13e9a589b9a45d5cb2a06ff"
|
||||
url: "https://github.com/deckerst/aves_panorama_motion_sensors.git"
|
||||
source: git
|
||||
version: "0.1.0"
|
||||
|
@ -861,7 +861,7 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: aves
|
||||
resolved-ref: "89fbc3f1ecfd9be56cf9b4b674aa0aec15cae61e"
|
||||
resolved-ref: "7ed465f893c3998b38230cbbcd7b2f3f8b873845"
|
||||
url: "https://github.com/deckerst/aves_panorama.git"
|
||||
source: git
|
||||
version: "0.4.1"
|
||||
|
@ -1218,10 +1218,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: smooth_page_indicator
|
||||
sha256: "8c301bc686892306cd41672c1880167f140c16be305d5ede8201fefd9fcda829"
|
||||
sha256: "725bc638d5e79df0c84658e1291449996943f93bacbc2cec49963dbbab48d8ae"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "1.1.0"
|
||||
source_map_stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1291,7 +1291,7 @@ packages:
|
|||
description:
|
||||
path: "."
|
||||
ref: HEAD
|
||||
resolved-ref: "7e1082771fd271a63ed41cbd72530f90f83a651a"
|
||||
resolved-ref: "89630a4f5a54121a784ea67cf3a40b89873db939"
|
||||
url: "https://github.com/deckerst/aves_streams_channel.git"
|
||||
source: git
|
||||
version: "0.3.0"
|
||||
|
|
File diff suppressed because one or more lines are too long
19
test/ref/bursts_test.dart
Normal file
19
test/ref/bursts_test.dart
Normal file
|
@ -0,0 +1,19 @@
|
|||
import 'package:aves/ref/bursts.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
test('Samsung burst', () {
|
||||
expect(BurstPatterns.getKeyForName('20151021_072800_006', [BurstPatterns.samsung]), '20151021_072800');
|
||||
expect(BurstPatterns.getKeyForName('20151021_072800_007', [BurstPatterns.samsung]), '20151021_072800');
|
||||
});
|
||||
|
||||
test('Sony burst', () {
|
||||
expect(BurstPatterns.getKeyForName('DSC_0006_BURST20151021072800123', [BurstPatterns.sony]), '20151021072800123');
|
||||
expect(BurstPatterns.getKeyForName('DSC_0007_BURST20151021072800123', [BurstPatterns.sony]), '20151021072800123');
|
||||
});
|
||||
|
||||
test('Sony predictive capture', () {
|
||||
expect(BurstPatterns.getKeyForName('DSCPDC_0002_BURST20180619163426901', [BurstPatterns.sony]), '20180619163426901');
|
||||
expect(BurstPatterns.getKeyForName('DSCPDC_0003_BURST20180619163426901_COVER', [BurstPatterns.sony]), '20180619163426901');
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue