[gpodder] Re: device sync: per-channel settings

  • From: Rafi Rubin <rafi@xxxxxxxxxxxxxxxx>
  • To: gpodder@xxxxxxxxxxxxx
  • Date: Thu, 30 Aug 2012 05:02:19 -0400

On 08/30/12 02:58, Thomas Perl wrote:
> Hi,
> 
> 2012/8/30 Rafi Rubin <rafi@xxxxxxxxxxxxxxxx>:
>> Is anyone working on per-channel or per-device sync settings?
>> 
>> I'd like to help or implement something soon.  At the moment, I can't
>> easily sink without filling up my phone :)
>> 
>> 
>> A quick and dirty implementation (approximately the behavior of gpodder
>> 2): https://github.com/rafiyr/gpodder/commits/pause_sync
> 
> Thanks - don't forget to bump the schema version (CURRENT_VERSION) in 
> schema.py and also provide update commands from the previous version 
> (UPGRADE_SQL) in that file. In the function convert_gpodder2_db, you should
> also add the newly-added column to the values for inserting into the
> database, in case of the sync enable/disable flag, that might also be in
> the gpodder2 database, so migrating it there would be a good idea.

I'll have a look.  Thanks for the pointer.  I haven't really read through the
code, just been poking around so far.  :)

> As you can't insert columns in SQLite between old columns (see 
> http://www.sqlite.org/lang_altertable.html) without having to resort to
> temporary tables and copying, add the new column at the end of the list of
> columns, so that users upgrading from old database versions and users
> installing gPodder afresh have the same ordering of columns. Also, what
> about naming the column "sync_enabled", defaulting to 1 (INTEGER NOT NULL
> DEFAULT 1)?

Guess I'm spoiled from using nicer dbs.  Does the update function copy and
rebuild the table, or are you suggesting that I put the field at the end of
the list?  Does column order matter in this case?  Is it just cosmetic or are
there portions of the code that actually depend on field order in records (I
know that can go either way depending on certain sql syntax).

Looks like the old field name was "sync_to_devices".  Do you prefer that or
your suggested "sync_enabled"?

> PS: Will you be submitting a merge request for 
> https://github.com/rafiyr/gpodder/commit/d91b837880? :)

Thought I already did.  Should I try again?


Other related posts: