-
Notifications
You must be signed in to change notification settings - Fork 371
Fix video location extraction on Android and improve LatLng API #1337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: AlexV525 <[email protected]>
Co-authored-by: AlexV525 <[email protected]>
|
@copilot You should put the implementation deeper into dbutils rather than the plugin interface. |
Co-authored-by: AlexV525 <[email protected]>
Refactored the implementation to the DBUtils layer in commit fbe2c38. The video location extraction logic is now in |
|
@copilot Update the top comment to reflect all changes in this PR |
Updated PR description to reflect all changes: Fix video location extraction on Android using MediaMetadataRetriever
ChangesAndroid (Kotlin)
Dart/Flutter API
Example App
Implementation DetailsVideos store location in ISO 6709 format (e.g., Breaking Changes
|
AssetEntity.latlngAsync()was returning zero for videos on Android becauseExifInterfaceonly supports images. This PR fixes video location extraction and improves theLatLngAPI with better null safety.Changes
Android (Kotlin)
IDBUtils.ktgetLatLong(context: Context, id: String): DoubleArray?as a default interface methodparseLocationString()helper to parse ISO 6709 format ("+37.4219-122.0840/")PhotoManager.ktgetLocation()to delegate todbUtils.getLatLong(context, id)AndroidQDBUtils.ktDart/Flutter API
lib/src/types/entity.dartLatLng:LatLng.fromValues()factory method for nullable/zero values (returns null for invalid coordinates)toString()method returning"latitude,longitude"formatAssetEntity:latitudeandlongitudeconstructor parameters (uselatLnginstead)latLngparameter and getterlatlngAsync()return type fromLatLngtoLatLng?latitudeandlongitudegetters to derive fromlatLngconstto regular constructorlib/src/internal/plugin.dartgetLatLngAsync()to returnLatLng?instead ofLatLngLatLng.fromValues()factory for safe constructionlib/src/utils/convert_utils.dartExample App
example/lib/page/image_list_page.dartexample/lib/util/common_util.dartshowResultDialog()helper method for displaying async resultsshowInfoDialog()to handle nullableLatLngreturn fromlatlngAsync()Other
CHANGELOG.mdanalysis_options.yamlTest files
LatLngconstructor requirementsImplementation Details
Videos store location in ISO 6709 format (e.g.,
"+37.4219-122.0840/"or"+37.4219-122.0840"). The parser:Architecture
The implementation follows proper layering by placing the video location extraction logic in the database utilities layer (
IDBUtilsas a default interface method) rather than the plugin interface (PhotoManager), consistent with other similar methods likegetExif().Breaking Changes
LatLngclass:latitudeandlongitudeare now non-nullableLatLng.fromValues()for nullable/zero coordinates (returnsLatLng?)AssetEntity:latlngAsync()now returnsLatLng?instead ofLatLnglatitudeandlongitudeconstructor parameters are deprecated (uselatLnginstead)constMigration Guide
Before:
After:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.