~hristoast/mousikofidi

7b1d2b8eb0e3cf359e9f35c4659f1d210dac6376 — Hristos N. Triantafillou 11 months ago 9c3746a 0.21
Don't show "0" when there's no tracktotal (#99)
3 files changed, 11 insertions(+), 6 deletions(-)

M example/real.flac
M mousikofidi/templates/item_table.html
M test_mousikofidi.py
M example/real.flac => example/real.flac +0 -0

M mousikofidi/templates/item_table.html => mousikofidi/templates/item_table.html +6 -3
@@ 42,7 42,8 @@

            <td class="center mobile-hide"> {# TRACK #}
              {% if item.track and not item.tracktotal %}{{ item.track }}{% endif %}
              {% if item.track and item.tracktotal %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal != "0" %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal == "0" %}{{ item.track }}{% endif %}
            </td>

            {% if playlist_add %}


@@ 107,7 108,8 @@

            <td class="center mobile-hide"> {# TRACK #}
              {% if item.track and not item.tracktotal %}{{ item.track }}{% endif %}
              {% if item.track and item.tracktotal %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal != "0" %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal == "0" %}{{ item.track }}{% endif %}
            </td>

            {% if playlist_add %}


@@ 201,7 203,8 @@

            <td class="center mobile-hide">
              {% if item.track and not item.tracktotal %}{{ item.track }}{% endif %}
              {% if item.track and item.tracktotal %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal != "0" %}{{ item.track }}/{{ item.tracktotal }}{% endif %}
              {% if item.track and item.tracktotal and item.tracktotal == "0" %}{{ item.track }}{% endif %}
            </td>

            {% if playlist_add %}

M test_mousikofidi.py => test_mousikofidi.py +5 -3
@@ 77,7 77,7 @@ def test_audio_dict_flac():
        "title_mobile": "MousikóFídi Test FLAC",
        "track": "34",
        "type": "audio",
        "tracktotal": None,
        "tracktotal": "0",
        "file_name": "real.flac",
        "file_name_mobile": "real.flac",
        "escaped_path": "{}%2Freal.flac".format(example_dir_escaped),


@@ 151,6 151,7 @@ def test_audio_metadata_real_flac():
        "DATE": "2019-08-08",
        "ENCODED-BY": "FLAC Encoded-by",
        "TRACKNUMBER": "34",
        "TRACKTOTAL": "0",
        "GENRE": "MousikóFídi Test",
        "LYRICS": "Test FLAC Lyrics!",
        "length": "0:04",


@@ 422,7 423,7 @@ def test_browse_dir():
                "title": "MousikóFídi Test FLAC",
                "title_mobile": "MousikóFídi Test FLAC",
                "track": "34",
                "tracktotal": None,
                "tracktotal": "0",
                "file_name": "real.flac",
                "file_name_mobile": "real.flac",
                "escaped_path": "{}%2Fexample%2Freal.flac".format(escaped_sourcedir),


@@ 1021,7 1022,7 @@ def test_get_metadata_dict_real_audio():
        "lyrics": "Test FLAC Lyrics!",
        "title": "MousikóFídi Test FLAC",
        "track": "34",
        "tracktotal": None,
        "tracktotal": "0",
    }




@@ 2119,6 2120,7 @@ def test_dir_detail_found(client):
    assert b"fake.mp3" in rv.data
    assert b"fake.ogg" in rv.data
    assert b"fake.webm" in rv.data
    assert b"34/0" not in rv.data
    assert bytes("MousikóFídi Test Album", "utf8") in rv.data
    assert bytes("MousikóFídi Test Artist", "utf8") in rv.data
    assert bytes("MousikóFídi Test FLAC", "utf8") in rv.data