From 87b444684a54770a8095ae42bf660f3ff55d0001 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Wed, 22 Oct 2014 11:35:00 +0200 Subject: [PATCH] Follow symlinks for music folder scan. Fixes #1953 --- headphones/librarysync.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/headphones/librarysync.py b/headphones/librarysync.py index e8a126cc..e9011637 100644 --- a/headphones/librarysync.py +++ b/headphones/librarysync.py @@ -78,9 +78,11 @@ def libraryScan(dir=None, append=False, ArtistID=None, ArtistName=None, cron=Fal latest_subdirectory = [] - for r,d,f in os.walk(dir): - #need to abuse slicing to get a copy of the list, doing it directly will skip the element after a deleted one - #using a list comprehension will not work correctly for nested subdirectories (os.walk keeps its original list) + for r,d,f in os.walk(dir, followlinks=True): + # Need to abuse slicing to get a copy of the list, doing it directly + # will skip the element after a deleted one using a list comprehension + # will not work correctly for nested subdirectories (os.walk keeps its + # original list) for directory in d[:]: if directory.startswith("."): d.remove(directory)