bhelm1 1 Posted September 4, 2020 Share Posted September 4, 2020 One question with this. I left all the folders in place so as I add shows the folder structure is ready. However, when I pull up the Looney Tunes I see all the empty folders and have to go to the very bottom to find the shows at least in folder view. Any way to hide the empty folders? Link to comment Share on other sites More sharing options...
yaksplat 58 Posted September 11, 2020 Share Posted September 11, 2020 (edited) double post Edited September 11, 2020 by yaksplat Link to comment Share on other sites More sharing options...
yaksplat 58 Posted September 11, 2020 Share Posted September 11, 2020 On 9/3/2020 at 9:16 PM, bhelm1 said: One question with this. I left all the folders in place so as I add shows the folder structure is ready. However, when I pull up the Looney Tunes I see all the empty folders and have to go to the very bottom to find the shows at least in folder view. Any way to hide the empty folders? use a PowerShell script. (gci E:\ServerFolders\Music -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | Remove-Item -recurse -whatif This will show what empty directories would be deleted. if you like what you see, run it again without the -whatif 1 Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted September 11, 2020 Share Posted September 11, 2020 For reference for those that dont read Powershell Aliases here is a more verbose version and a little explanation of what does what also an alternative way - rather than everything on one line. (Get-ChildItem -LiteralPath "E:\ServerFolders\Music" -Recurse | Where-Object {$_.PSIsContainer -eq $True}) | Where_Object {$_.GetFileSystemInfos().Count -eq 0} | Remove-Item -Recurse -whatif or another way # List of only Folders below the path specified with a recursive search # .PSIsContainer is a folder in PS speak # -literalPath ensures any path that might have [] within it does not get interpreted as regex $ListOfDir = Get-ChildItem -LiteralPath 'E:\ServerFolders\Music' -Recurse | Where-Object {$_.PSIsContainer -eq $True} # filter by empty folders i.e with count of 0 for files/sub folders $ListOfDir_ToDelete = $ListOfDir | Where_Object {$_.GetFileSystemInfos().Count -eq 0} # test what would be deleted with -WhatIf # -Recurse not needed # will print to console what would be deleted $ListOfDir_ToDelete | Remove-Item -Whatif # when happy with result remove the "-whatif" # NOTE - once deleted they are gone - you will not find them in the recycle bin! So be careful # if you want to just list the folders then just - will write it to the screen - although not very useful and in the default format :) $ListOfDir_ToDelete #or To a File with utf8 encoding to cover any non ASCII characters that may be present in folder names Write-Output $ListOfDir_ToDelete | Out-File -FilePath "F:\Dir_log.txt" -Encoding utf8 Have fun @yaksplat I did this as a lot of users will not be familiar with PS let alone aliases (special place in hell for those that came up with aliases) which i personally hate - but there is nothing wrong in using them 1 Link to comment Share on other sites More sharing options...
KellyEmby 10 Posted September 21, 2022 Share Posted September 21, 2022 (edited) I don't remember who turned me on to this program, but it has made all the difference for me! "Rename My TV Series" by www.tweaking4all.com The other one I use a lot is "Bulk Rename Utility" They both have been extremely helpful in getting things named so Emby can do its job... and Emby really does a great job! Thanks for the Program!! Edited September 21, 2022 by KellyEmby 1 Link to comment Share on other sites More sharing options...
yaksplat 58 Posted September 21, 2022 Share Posted September 21, 2022 I use Sonarr for maintaining structure and renaming files. It also keeps track of what's there, what's missing and when shows are on. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now