Notices


Reply
Thread Tools
Posts: 70 | Thanked: 39 times | Joined on Mar 2010
#1
I tried using PC Suite to sync my pictures and videos taken by the camera but it ended up downloading also video podcasts, wallpaper, ... basically any pictures and videos that it could find on my N900 (DCIM, .images and .videoes), not just the files in DCIM!

Is everyone finding this anonying? Am I missing a magical setting?
 
danx's Avatar
Posts: 304 | Thanked: 20 times | Joined on Jan 2010 @ irvine
#2
go to yout pc suite and click on the settings an i think advance settings . from there you can pick what you want to sinc
 
Posts: 70 | Thanked: 39 times | Joined on Mar 2010
#3
I can only pick the location of the videos but not for the pictures.
 
Posts: 70 | Thanked: 39 times | Joined on Mar 2010
#4
Well, I finally wrote a python script to move them into folders (e.g. 2010-03, 2010-04, etc) and then I configured my rsyncd.conf to run that script "pre-xfer".

Code:
#!/usr/bin/python

import os, datetime
from stat import *

# The DCIM directory, where the pictures and videos are
# stored by the N900
dcim = "/home/user/MyDocs/DCIM/"

# The DCIM directory protection mode
dcimProtMode = os.stat(dcim).st_mode

# Picture or video file extensions
pic_vid_extensions = ['.jpg', '.png', '.mp4', '.avi']

def isPicOrVid(pathname):
  isPicOrVid = False

  ext = os.path.splitext(pathname)[1]
  if ext in pic_vid_extensions:
    isPicOrVid = True

  return isPicOrVid

for f in os.listdir(dcim):
  pathname = os.path.join(dcim, f)
  mode = os.stat(pathname)[ST_MODE]

  # If it's a file...
  if S_ISREG(mode) and isPicOrVid(pathname):

    # Get the file creation timestamp
    ts = os.stat(pathname).st_ctime
    cTime =  datetime.datetime.fromtimestamp(ts)

    # Create a directory based on file creation date (yyyy-mm)
    # ... if one does not exist yet
    yearMonth = cTime.strftime("%Y-%m")    
    mdDir = os.path.join(dcim, yearMonth)
    if not os.path.exists(mdDir):
      print "Directory %s does not exists. Creating..." % (mdDir)
      os.mkdir(mdDir, dcimProtMode)

    # Move the file from DCIM to the subdirectory created above
    newpathname = os.path.join(mdDir, f)
    print "Moving %s to %s" % (f, mdDir)
    os.rename(pathname, newpathname)
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:12.