objects = query.MediaCollectionManager()
def __unicode__(self):
+ if self.title:
+ return self.title
+
return self.code
@property
computed_duration.verbose_name = _('computed duration')
def __unicode__(self):
- if self.code:
- return self.code
- return self.old_code
+ if self.title and not re.match('^ *N *$', self.title):
+ title = self.title
+ else:
+ title = unicode(self.collection)
+
+ if self.track:
+ title += ' ' + self.track
+
+ return title
class MediaPart(MediaResource):
"Describe an item part"
#EXTM3U{% load telemeta_utils %}{% for item in collection.items.all %}
-#EXTINF:{{ item.get_duration }},{{ item.title }}
+#EXTINF:{{ item.get_duration }},{{ item }}
http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}{% endfor %}
{% endblock %}\r
\r
{% block content %}\r
- <h3>Collection: {{ collection.title }}</h3>\r
+ <h3>Collection: {{ collection }}</h3>\r
<div class="{% if collection.has_mediafile %}with-rightcol{% endif %}">\r
{% if collection.has_mediafile %}\r
<div id="rightcol">\r
{% if collection %}
{% block submenu %}
- <h3>Collection: {{ collection.title }}</h3>
+ <h3>Collection: {{ collection }}</h3>
<div><a href="{% url telemeta-collection-detail collection.public_id %}">Normal View</a></div>
{% endblock %}
{% block tracklist %}
{% for item in collection.ordered_items %}
<track>
- <title>{{ item.title }}</title>
+ <title>{{ item }}</title>
<meta rel="type">mp3</meta>
<location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
<duration>{{ item.get_duration|mul:1000 }}</duration>
{% endif %}
<ul>
{% for p in collections %}
- <li><a href="{% url telemeta-collection-detail p.public_id %}">{{ p.title }}</a>
+ <li><a href="{% url telemeta-collection-detail p.public_id %}">{{ p }}</a>
</li>
{% endfor %}
{% if more_collections %} <li>[...]</li> {% endif %}
{% endif %}
<ul>
{% for p in items %}
- <li><a href="{% url telemeta-item-detail p.public_id %}">{{ p.title }}</a></li>
+ <li><a href="{% url telemeta-item-detail p.public_id %}">{{ p }}</a></li>
{% endfor %}
{% if more_items %} <li>[...]</li> {% endif %}
</ul>
\r
{% block content %}\r
\r
-<h3>Item : {{ item.title }}</h3>\r
+<h3>Item : {{ item }}</h3>\r
<div class="{% if item.file %}with-rightcol{% endif %}">\r
\r
{% if item.file %}\r
{% dl_field item "title" %}\r
{% dl_field item "alt_title" %}\r
{% dl_field item "collector" %}\r
- {% if item.collection.title %}\r
- <dt>{% trans "Collection title" %}</dt>\r
- <dd>{{ item.collection.title }}</dd>\r
- {% endif %}\r
+ {% dl_field item "collection" %}\r
{% if item.recorded_from_date %}\r
<dt>{% trans "Recording date" %}</dt>\r
<dd>{{ item.recorded_from_date }} {{ item.recorded_to_date|prepend:" - " }}</dd>\r
\r
{% if item %}\r
{% block submenu %}\r
- <h3>Item: {{ item.title }}</h3>\r
+ <h3>Item: {{ item }}</h3>\r
<div><a href="{% url telemeta-item-detail item.id|urlencode %}">Normal View</a></div>\r
{% endblock %}\r
\r
{% block tracklist %}
<track>
- <title>{{ item.title }}</title>
+ <title>{{ item }}</title>
<meta rel="type">mp3</meta>
<location>http://{{ host }}{% url telemeta-item-export item.public_id,"mp3" %}</location>
<duration>{{ item.get_duration|mul:1000 }}</duration>