from telemeta.views.core import *
from telemeta.views.marker import *
import timeside.core
+from timeside.server import models as TS_models
+import timeside.server.models as TS_models
class ItemBaseMixin(TelemetaBaseMixin):
analyzers = timeside.core.processor.processors(timeside.core.api.IAnalyzer)
value_analyzers = timeside.core.processor.processors(timeside.core.api.IValueAnalyzer)
+
+
export_enabled = getattr(settings, 'TELEMETA_DOWNLOAD_ENABLED', True)
export_formats = getattr(settings, 'TELEMETA_DOWNLOAD_FORMATS', ('mp3', 'wav'))
default_grapher_id = getattr(settings, 'TIMESIDE_DEFAULT_GRAPHER_ID', ('waveform_simple'))
image_file = old_image_file
if not self.cache_data.exists(image_file):
- source = item.get_source()
+ source, _ = item.get_source()
if source:
path = self.cache_data.dir + os.sep + image_file
decoder = timeside.core.get_processor('file_decoder')(source)
mime_type = encoder.mime_type()
file = public_id + '.' + encoder.file_extension()
- source = item.get_source()
+ source, _ = item.get_source()
flag = MediaItemTranscodingFlag.objects.filter(item=item, mime_type=mime_type)
if not flag:
analyzers_sub = []
graphers_sub = []
- source = item.get_source()
+ source, _ = item.get_source()
+
if source:
- decoder = timeside.core.get_processor('file_decoder')(source)
- pipe = decoder
+ print '***************************'
+ print source
+ print '***************************'
+
+ decoder = timeside.core.get_processor('file_decoder')(source)
+ pipe = decoder = timeside.core.get_processor('file_decoder')(source)
for analyzer in self.value_analyzers:
subpipe = analyzer()
previous, next = self.item_previous_next(item)
+ # Corresponding TimeSide Item
+ source, source_type = item.get_source()
+ if source:
+ ts_item, c = TS_models.Item.objects.get_or_create(**{source_type: source})
+ if c:
+ ts_item.title = item.title
+ ts_item.save()
+
self.item_analyze(item)
#FIXME: use mimetypes.guess_type
context['format'] = item_format
context['private_extra_types'] = private_extra_types.values()
context['site'] = 'http://' + Site.objects.all()[0].name
+ if ts_item:
+ context['ts_item_id'] = ts_item.pk
+ else:
+ context['ts_item_id'] = None
+
return context