[gpodder-devel] Human-readable download folders, please test (was: Re: Non-human readable directory and file names)

  • From: nikosapi at gmail.com (nikosapi)
  • Date: Sat, 3 Nov 2007 12:17:03 -0400

On November 2, 2007 13:54:38 Thomas Perl wrote:
> Hello, Nick!
>
> On Thu, 2007-11-01 at 15:51 -0400, nikosapi wrote:
> > I've been looking through the suggestions and an idea that didn't come
> > up was a simple enumeration at the beginning or ending of directory
> > and file names. For example it could look something like this:
> >
> > ~/{download dir}/{number}-{<title> (cut off if too long)}/
> > {number}-{show title (also cut off if too long) or original
> > filename}.ext
> >
> > ~/gpodder-downloads/03-This_Week_in_Tech/19-Some_random_show.mp3
> >
> > The numbers could be assigned randomly (in that case a bigger number
> > would be needed) or the numbers could simply be counters that gpodder
> > keeps track of.
> >
> > I think this would be nicer than having to descend through many oddly
> > named directories to find a show you're looking for.
>
> Your proposal sounds reasonable, and it might be something we should
> think about if we are going to change the internal structure of the
> download folder. Of course, we have to make a number-URL mapping and
> save that somewhere so we can always find the right number to determine
> the file name.
>
> Anyway, I've been working on a compatible hard-linking system that will
> preserve the download folder structure, generate a new structure that
> (given it resides on the same filesystem as the download folder and it
> supports hard links) will not use any additional hard disk space and is
> even compatible with renames.
>
> Save the two attached scripts somewhere in your $PATH and don't forget
> to set the PYTHONPATH variable to the "src/" subfolder of your SVN
> checkout, so the scripts will find the gPodder libraries.
>
>     Usage: gdfs-init.py [--yes] [Podcasts dir]
>
>         Populates "Podcasts dir" with hard links from gPodder's
>         downloads folder. "Podcasts dir" should be on the same
>         filesystem as the downloads folder, and the filesystem
>         has to support hard links.
>
>         If "Podcasts dir" already exists, the script will ask
>         to overwrite its contents and re-build the mirror.
>
>         The optional "--yes" parameter will skip the overwrite
>         question and foribly re-build the folder if it exists.
>
>     Usage: gdfs-check.py [from-gpodder|from-podcasts] [Podcasts dir]
>
>         If you have deleted episodes from your Podcast mirror
>         folder, use "from-podcasts" to get a list of files
>         that you have to delete from gPodder's download
>         folder to "sync" with your podcast mirror.
>
>         If you have deleted episodes in gPodder, you can use
>         "from-gpodder" to get a list of files that are still
>         available in your podcasts dir, but not in gPodder's
>         download directory.
>
> So, basically, to get things going, download the two scripts to your
> Desktop, run "python gdfs-init.py --yes Podcasts" and you should have
> your podcasts in human-readable folder and file names on your Desktop.
>
> You can always refresh this "mirror" of your download directory by
> running the same command again, which will overwrite the old "Podcasts"
> folder.
>
> Please try out these scripts and tell me how they work for you. Maybe we
> can do some more integration into gPodder when things are tested and
> users are happy with this solution.
>
>
> Thomas

It works great, I didn't notice any problems. It's funny because I was 
thinking of something similar but disregarded the idea because it seemed too 
complicated, but you did it :)

If a few more people could test it (maybe people with big gpodder libraries) I 
think it would be a really cool feature. 

nick


Other related posts: