TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

[BUG] The Date fields are not working.

Open bigjohn98pl opened this issue 1 year ago • 4 comments

Sw version: 9.2.1

When user want to add the Date fields (Date, Date Created, Date_x...) then the filed is added without date or the filed have old data from another filed.

Actions:

  1. Click on the picture
  2. Click on the "Add Field" button
  3. Choose filed with the date
  4. Add the filed

Expected:

  • new data filed is added with the right data format.

Observed:

  • Every date type filed is empty or have values form other fields.

image image

bigjohn98pl avatar May 23 '24 22:05 bigjohn98pl

I ran into a similar issue while trying to debug the last issue I fixed. I have a good idea of what the source of the issue of the dates having values of other fields. I'll take a jab at it tonight.

In terms of the date field, is your issue that you can't edit the field or that you would prefer the date field gets created with a default date instead of starting blank? (whether that be the current date or another default date)

michaelmegrath avatar May 23 '24 23:05 michaelmegrath

Right now date fields are implemented on the backend, but there's currently no frontend for the user to modify them with. The incorrect fields being shown on them might be related to #92

CyanVoxel avatar May 23 '24 23:05 CyanVoxel

When I fixed #115 I found that the Containers list in preview panel appears to get out of order with the backend when it is sorted with "Alt + S", there is a chance that there are other ways it gets out of order as well.

michaelmegrath avatar May 23 '24 23:05 michaelmegrath

I ran into a similar issue while trying to debug the last issue I fixed. I have a good idea of what the source of the issue of the dates having values of other fields. I'll take a jab at it tonight.

In terms of the date field, is your issue that you can't edit the field or that you would prefer the date field gets created with a default date instead of starting blank? (whether that be the current date or another default date)

I think the the dates should be set using the meta data form the file. This information is already set, so why we don't use it? We can use pymediainfo module to get information about the file_creation_date and file_last_modification_date.

from pymediainfo import MediaInfo

def get_full_metadata(file_path):
    media_info = MediaInfo.parse(file_path)
    for track in media_info.tracks:
        print(f"Track type: {track.track_type}")
        for key, value in track.to_data().items():
            print(f"{key}: {value}")

file_path = 'path_to_your_file.jpg'
get_full_metadata(file_path)

bigjohn98pl avatar May 24 '24 14:05 bigjohn98pl