Skip to content

Commit

Permalink
Duplicates: Take symbolic links into account
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
clefebvre committed May 31, 2023
1 parent c1f3dfe commit 26c5706
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions usr/lib/thingy/thingy.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def clear_flowbox(self):
@idle
def add_document_to_library(self, uri, app_id, mark_as_favorite):
# Ignore duplicates
if uri in self.documents:
real_path = os.path.realpath(uri)
if real_path in self.documents:
return
f = Gio.File.new_for_uri(uri)
# Ignore non-existing paths
Expand All @@ -244,7 +245,7 @@ def add_document_to_library(self, uri, app_id, mark_as_favorite):
# Ignore hidden mimetypes
if app_id in HIDDEN_MIMETYPES and info.get_content_type() in HIDDEN_MIMETYPES[app_id]:
return
self.documents.append(uri)
self.documents.append(real_path)
name = info.get_display_name()
thumbnail_path = info.get_attribute_byte_string ("thumbnail::path")
icon = info.get_attribute_object("standard::icon")
Expand Down

0 comments on commit 26c5706

Please sign in to comment.