Skip to content

Commit

Permalink
CWR 2.2 done
Browse files Browse the repository at this point in the history
  • Loading branch information
matijakolaric committed Dec 28, 2020
1 parent e728ee1 commit c080366
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
13 changes: 12 additions & 1 deletion music_publisher/cwr_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,18 @@
'{{ cd_identifier|ljust:15 }}0000{{ library|ljust:60 }}' +
' ' * (26 + 12 + 60 + 20) + '0000' + ' ' * (18 + 26 + 42) + '\r\n'
'{% endautoescape %}'),

'REC': Template(
'{% load cwr_filters %}{% autoescape off %}'
'REC{{ transaction_sequence|rjust:8 }}'
'{{ record_sequence|rjust:8 }}'
'{{ release_date|default:"00000000" }}' +
' ' * 60 + '{{ duration|rjust:6|default:"000000" }} ' +
' ' * 151 +
'{{ isrc|ljust:12 }} '
'{{ recording_title|ljust:60 }}{{ version_title|ljust:60 }}'
'{{ display_artist|ljust:60 }}{{ record_label.name|ljust:60 }}'
'{{ isrc_validity|ljust:20 }}{{ code|ljust:14 }}'
'\r\n{% endautoescape %}'),
'XRF': Template(
'{% load cwr_filters %}{% autoescape off %}'
'XRF{{ transaction_sequence|rjust:8 }}'
Expand Down
4 changes: 2 additions & 2 deletions music_publisher/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,8 +1142,8 @@ class Meta:
('REV', 'CWR 2.1: Revisions of registered works'),
('NW2', 'CWR 2.2: New work registrations'),
('RE2', 'CWR 2.2: Revisions of registered works'),
('WRK', 'CWR 3.0: Work registration (experimental)'),
('ISR', 'CWR 3.0: ISWC EDI request (experimental)')
('WRK', 'CWR 3.0: Work registration'),
('ISR', 'CWR 3.0: ISWC request (EDI)')
))
cwr = models.TextField(blank=True, editable=False)
year = models.CharField(
Expand Down
2 changes: 2 additions & 0 deletions music_publisher/templates/raw_cwr.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="artist" title="Performing artist">{{ line|slice:'19:79' }}</span>{{ line|slice:'79:' }}</pre></div>
{% elif rt == 'REC' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span>{{ line|slice:'19:45' }}<span class="title" title="Recording title">{{ line|slice:'45:105' }}</span><span class="title" title="Version title">{{ line|slice:'105:165' }}</span><span class="artist" title="Recording artist">{{ line|slice:'165:225' }}</span>{{ line|slice:'225:' }}</pre></div>
{% elif rt == 'XRF' %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span><span class="prshare" title="Society: {{ line|slice:'19:23'|soc_name }}">{{ line|slice:'19:23' }}</span><span class="iswc" title="Code">{{ line|slice:'23:37' }}</span>{{ line|slice:'36:' }}</pre></div>
{% else %}
<div class="{{ rt }}"><pre><span class="record_type">{{ rt }}</span><span class="counters">{{ line|slice:'3:19' }}</span>{{ line|slice:'19:' }}</pre></div>
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions music_publisher/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,7 @@ def test_work(self):
cwr.works.add(work)
cwr.create_cwr()


ACK_CONTENT_21 = """HDRSO000000021BMI 01.102018060715153220180607
GRHACK0000102.100020180607
ACK0000000000000000201805160910510000100000000NWRONE Z128 123 20180607AS
Expand Down

0 comments on commit c080366

Please sign in to comment.