mirror of
https://github.com/SoPat712/BeReal-Export-Manager.git
synced 2025-08-21 18:28:46 -04:00
outsourced functions to get filename and location
This commit is contained in:
14
main.py
14
main.py
@@ -1,16 +1,20 @@
|
|||||||
import json
|
import json
|
||||||
|
import exiftool
|
||||||
|
|
||||||
|
def get_img_filename(image: json):
|
||||||
|
return image['path'].split("/")[-1]
|
||||||
|
|
||||||
def print_memories_info(data):
|
def get_memory_location(memory: json):
|
||||||
|
return memory['location'] if 'location' in memory else 'N/A'
|
||||||
|
|
||||||
|
def print_memories_info(data: json):
|
||||||
n = 0
|
n = 0
|
||||||
for i in data:
|
for i in data:
|
||||||
print("\nBeReal Nr. %s: " % n)
|
print("\nBeReal Nr. %s: " % n)
|
||||||
f_image = i['frontImage']
|
|
||||||
b_image = i['backImage']
|
|
||||||
print(" - Time Taken: %s\n - Front Image: %s\n - Back Image: %s\n - Location: %s"
|
print(" - Time Taken: %s\n - Front Image: %s\n - Back Image: %s\n - Location: %s"
|
||||||
% (i['takenTime'],
|
% (i['takenTime'],
|
||||||
f_image['path'].split("/")[-1], b_image['path'].split("/")[-1],
|
get_img_filename(i['frontImage']), get_img_filename(i['backImage']),
|
||||||
i['location'] if 'location' in i else 'N/A'))
|
get_memory_location(i)))
|
||||||
n+=1
|
n+=1
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user