On Wed, Aug 19, 2009 at 1:15 PM, fruity<[email protected]> wrote:
> I haven't yet arrived to the real controller itself since I can't finish
> to import my collection.
> It would be nice to have it that does not raise an error but rather skip
> and report. I'll try my best shot
If you want a quick hack of the Song.save() method to skip bad
encodings, modify the Song.save() method in wtsite/mediapool/models.py
and.....
CHANGE THIS:
if type(self.filename).__name__=='unicode':
self.filename = smart_str(self.filename)
if not ( access(str(self.filename), (F_OK or R_OK))):
return
TO THIS:
if type(self.filename).__name__=='unicode':
self.filename = smart_str(self.filename)
try:
smart_unicode(self.filename)
except:
return
if not ( access(str(self.filename), (F_OK or R_OK))):
return
This will try to convert the filepath to unicode and if it doesn't
work, then it will just skip the save method. This is just a hack.
Of course, it doesn't 'report' anything, but you could at least get
some audio files in the mediapool to play with.
In the meantime, I have been trying to find out how to address this
permanently (and it's turning into quite the wild goose chase)
--
Chris Everest
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users