Skip to content

Commit cb10cb9

Browse files
committed
#249 - Add author data support
Add author data in json parsing and replace user preference in edit page. This should not influence default author upload
1 parent cb25614 commit cb10cb9

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/components/modals/image_info_modal.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ class ImageInfoModal extends StatelessWidget {
4949
style: Theme.of(context).textTheme.titleMedium,
5050
),
5151
),
52-
if (image.comment != null) Text(image.comment!),
52+
if (image.comment != null) Text("${appStrings.editImageDetails_comments} : ${image.comment!}"),
53+
if (image.author != null) Text("${appStrings.editImageDetails_author} : ${image.author!}"),
5354
const SizedBox(height: 8.0),
5455
SettingsSection(
5556
margin: EdgeInsets.zero,

lib/models/image_model.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class ImageModel {
99
bool favorite;
1010
String file;
1111
String? name;
12+
String? author;
1213
String? comment;
1314
String? dateCreation;
1415
String? dateAvailable;
@@ -44,6 +45,7 @@ class ImageModel {
4445
favorite = json['is_favorite'] ?? false,
4546
file = json['file'].toString(),
4647
name = json['name']?.toString(),
48+
author = json['author']?.toString(),
4749
comment = json['comment'],
4850
dateCreation = json['date_creation'],
4951
dateAvailable = json['date_available'],

lib/views/image/edit_image_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class _EditImagePageState extends State<EditImagePage> {
4949
void initState() {
5050
_imageList = widget.images;
5151
_authorController =
52-
TextEditingController(text: Preferences.getUploadAuthor);
52+
TextEditingController(text: _imageList.first.author ?? "");
5353
if (_imageList.length == 1) {
5454
_titleController.text = _imageList.first.name ?? "";
5555
_descriptionController.text = _imageList.first.comment ?? '';

0 commit comments

Comments
 (0)