minor fixes
This commit is contained in:
parent
80752257be
commit
220e61784b
3 changed files with 4 additions and 5 deletions
|
@ -140,7 +140,7 @@ class VideoMetadataFormatter {
|
||||||
hour = int.tryParse(match.group(5)!) ?? 0;
|
hour = int.tryParse(match.group(5)!) ?? 0;
|
||||||
minute = int.tryParse(match.group(6)!) ?? 0;
|
minute = int.tryParse(match.group(6)!) ?? 0;
|
||||||
second = int.tryParse(match.group(7)!) ?? 0;
|
second = int.tryParse(match.group(7)!) ?? 0;
|
||||||
pm = match.group(9) == 'pm';
|
pm = {'pm', 'p. m.'}.contains(match.group(9));
|
||||||
}
|
}
|
||||||
|
|
||||||
final date = DateTime(year, month, day, hour + (pm ? 12 : 0), minute, second, 0);
|
final date = DateTime(year, month, day, hour + (pm ? 12 : 0), minute, second, 0);
|
||||||
|
|
|
@ -81,9 +81,8 @@ class PlatformMediaFetchService implements MediaFetchService {
|
||||||
}) as Map;
|
}) as Map;
|
||||||
return AvesEntry.fromMap(result);
|
return AvesEntry.fromMap(result);
|
||||||
} on PlatformException catch (e, stack) {
|
} on PlatformException catch (e, stack) {
|
||||||
// do not report issues with simple parameter-less media content
|
// do not report issues with media content as it is likely an obsolete Media Store entry
|
||||||
// as it is likely an obsolete Media Store entry
|
if (!uri.startsWith('content://media/')) {
|
||||||
if (!uri.startsWith('content://media/') || uri.contains('?')) {
|
|
||||||
await reportService.recordError(e, stack);
|
await reportService.recordError(e, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ void main() {
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('UTC 2021-05-30 19:14:21'), DateTime(2021, 5, 30, 19, 14, 21).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('UTC 2021-05-30 19:14:21'), DateTime(2021, 5, 30, 19, 14, 21).millisecondsSinceEpoch);
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('2021/10/31 21:23:17'), DateTime(2021, 10, 31, 21, 23, 17).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('2021/10/31 21:23:17'), DateTime(2021, 10, 31, 21, 23, 17).millisecondsSinceEpoch);
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('2021-09-10T7:14:49 pmZ'), DateTime(2021, 9, 10, 19, 14, 49).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('2021-09-10T7:14:49 pmZ'), DateTime(2021, 9, 10, 19, 14, 49).millisecondsSinceEpoch);
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('2022-01-28T5:07:46 p. m.Z'), DateTime(2022, 1, 28, 5, 7, 46).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('2022-01-28T5:07:46 p. m.Z'), DateTime(2022, 1, 28, 17, 7, 46).millisecondsSinceEpoch);
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('2012-1-1T12:00:00Z'), DateTime(2012, 1, 1, 12, 0, 0).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('2012-1-1T12:00:00Z'), DateTime(2012, 1, 1, 12, 0, 0).millisecondsSinceEpoch);
|
||||||
expect(VideoMetadataFormatter.parseVideoDate('2020.10.14'), DateTime(2020, 10, 14).millisecondsSinceEpoch);
|
expect(VideoMetadataFormatter.parseVideoDate('2020.10.14'), DateTime(2020, 10, 14).millisecondsSinceEpoch);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue