You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
grep -rlF "com.apple.metadata:_kMDItemUserTags""$n" --include='*@SynoEAStream'|whileread f ;do# filter only on SynoEAStream files that have the _kMDItemUserTags metadata field
25
+
# note: there may be hard linked files with a label (=colour tag) that have no @SynoEAStream file - on the mac side, these files
26
+
# appear to have a tag (label) but do not show up here. the labels are linked under water by the cnid db in afpd. on the
27
+
# syno side, the tag (label) will be picked up on the original file, which _does_ have the @SynoEAStream file
28
+
# note: (nested) directories with tag(s) within directories with links (marked by directory-/ e.g. path/genres-/Drama, or path/genres-/Sets/James Bond)
29
+
# must not be filtered, only the files within those, i.e. skip files _within_ "Drama", "Sets" or "James Bond", not these directories themselves, which may have a useful tag.
30
+
# note: this is equivalent to filtering the grep output through | grep -v -- '-/.*\.[^ ]' | sed -e 's#/@eaDir/#/#' -e 's#@SynoEAStream##', but that doesn't do the -all
31
+
# and is only marginally faster than the below (calling 'tag' is the bottleneck)
23
32
i=${f/@eaDir\/}; i=${i%@SynoEAStream}
24
-
t=$(tag "$f"| tr '\n'','); t=${t%,}
25
-
if [[ -n$t ]] ;then
26
-
# note: there may be hard linked files with a label (=colour tag) that have no @SynoEAStream file - on the mac side, these files
27
-
# appear to have a tag (label) but do not show up here. the labels are linked under water by the cnid db in afpd. on the
28
-
# syno side, the tag (label) will be picked up on the original file, which _does_ have the @SynoEAStream file
29
-
# note: (nested) directories with tag(s) within directories with links (marked by directory-/ e.g. path/genres-/Drama, or path/genres-/Sets/James Bond)
30
-
# must not be filtered, only the files within those, i.e. skip files _within_ "Drama", "Sets" or "James Bond", not these directories themselves, which may have a useful tag.
31
-
# note: the grep -a is to prevent grep interpreting the file name as binary "(Binary file (standard input) matches)" on file names with broken UTF-8 codes
32
-
# output result: path<tab>tag[,tag2...]
33
-
if [[ -n$all||-d$i|| ( -f $i&&$i!= *-/* ) ]] ;then# exclude files with tag(s) found within linked directories (directories whose name end with -)
33
+
if [[ -n$all||-d$i|| ( -f $i&&$i!= *-/* ) ]] ;then# exclude files with tag(s) found within linked directories (directories whose name end with -)
0 commit comments