Is there an existing issue for this?
What happened?
Description
All memory cards in the Memory Section are displaying the same tag, ‘Location’, even when the latitude and longitude values are null or the location name is empty. As a result, the sorting buttons do not produce accurate results.
Steps to reproduce
(Add some images I.e. 200)
- Launch PictoPy on your desktop.
- Click Memories Button on sidebar
- Observe that all memory cards display the ‘Location’ tag, even when no location data is available.
- Notice that the sorting buttons do not show appropriate values or results.
Expected Behaviour
- Memories that have a location (i.e., a location_name) should display the
Location tag.
- Memories without a location should display the
Date tag instead.
- The sorting buttons should show appropriate values and produce results accordingly.
Implementation
- When memory type is not a
Location in _create_simple_memory in memor_clustering.py then location_name = None and it's category will be 'Date' and added total_location to get total memories which has location.
# function to count total memories which has location
# this can also be done in tsx.
def find_total_location_memories(data:list) -> int:
tlm = 0 # total location memories
for memory in data:
if memory["location_name"] != None:
tlm +=1
return tlm
return {
"data": {
"memory_count": len(memories),
"image_count": len(images),
"memories": memories,
},
"total_location":tlm, #new key
"success": True,
"message": f"{len(memories)} memories ({location_count} location, {date_count} date)",
}
The above part can be done directly in frontend section
Updated locationCount Source: In MemoriesPage.tsx, the locationCount (displayed on the "Location" filter button) is now primarily taken from the total_location field returned by the backend's /api/memories/generate endpoint. If the data is not yet available, it falls back to a local calculation.
Location Tag Visibility: In MemoryCard.tsx, the "Location" badge is now displayed only when the location_name is not null. I updated the isDateBased logic to check for the absence of location_name instead of geographic coordinates.
Refined Filtering: In MemoriesPage.tsx, the filtering logic for the Location and Date buttons has been updated to use the location_name field. Clicking "Location" now correctly displays only memory cards where location_name is not null, ensuring consistent behavior between the counts and the displayed cards.
Screenshots
Before Screenshots:
- Displaying location tag even if there is no location available for this image

After Screenshots:
- Displaying correct Tagging and Sorting Values


Record
Is there an existing issue for this?
What happened?
Description
All memory cards in the Memory Section are displaying the same tag, ‘Location’, even when the latitude and longitude values are null or the location name is empty. As a result, the sorting buttons do not produce accurate results.
Steps to reproduce
(Add some images I.e. 200)
Expected Behaviour
Locationtag.Datetag instead.Implementation
Locationin_create_simple_memoryinmemor_clustering.pythenlocation_name = Noneand it's category will be'Date'and addedtotal_locationto get total memories which has location.The above part can be done directly in frontend section
Updated locationCount Source:InMemoriesPage.tsx, thelocationCount(displayed on the "Location" filter button) is now primarily taken from thetotal_locationfield returned by the backend's /api/memories/generate endpoint. If the data is not yet available, it falls back to a local calculation.Location Tag Visibility:InMemoryCard.tsx, the "Location" badge is now displayed only when the location_name is not null. I updated the isDateBased logic to check for the absence oflocation_nameinstead ofgeographic coordinates.Refined Filtering:InMemoriesPage.tsx, the filtering logic for the Location and Date buttons has been updated to use thelocation_namefield. Clicking "Location" now correctly displays only memory cards wherelocation_nameis not null, ensuring consistent behavior between the counts and the displayed cards.Screenshots
Before Screenshots:
After Screenshots:
Record