summaryrefslogtreecommitdiff
path: root/templates/import.html
blob: 50c27d6af56dd828a370c8b5d57e117f7944b011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{% extends "base.html" %}

{% block title %}Import · Lumière{% endblock %}

{% block content %}
  <section class="form-shell narrow">
    <div class="form-heading">
      <p class="eyebrow">Letterboxd</p>
      <h1>Import diary CSV</h1>
    </div>

    {% if error %}
      <div class="notice error">{{ error }}</div>
    {% endif %}

    <form class="film-form" method="post" action="/import/letterboxd" enctype="multipart/form-data">
      <div class="field">
        <label for="file">CSV export</label>
        <input id="file" name="file" type="file" accept=".csv,text/csv" required>
      </div>

      <div class="form-actions">
        <a href="/">Cancel</a>
        <button type="submit">Import entries</button>
      </div>
    </form>
  </section>

  <section class="form-shell narrow data-tools">
    <div class="form-heading compact-heading">
      <p class="eyebrow">Queue</p>
      <h1>Import watchlist CSV</h1>
    </div>

    <form class="film-form" method="post" action="/import/watchlist" enctype="multipart/form-data">
      <div class="field">
        <label for="watchlist-file">Watchlist CSV</label>
        <input id="watchlist-file" name="file" type="file" accept=".csv,text/csv" required>
      </div>

      <div class="form-actions">
        <a href="/queue">Cancel</a>
        <button type="submit">Import to queue</button>
      </div>
    </form>
  </section>

  <section class="form-shell narrow data-tools">
    <div class="form-heading compact-heading">
      <p class="eyebrow">TMDB</p>
      <h1>Fetch missing posters</h1>
    </div>

    <p class="muted">
      Match imported films against TMDB and fill blank posters plus missing metadata.
    </p>

    <form class="film-form" method="post" action="/data/enrich-posters">
      <div class="form-actions">
        <button type="submit">Fetch missing posters</button>
      </div>
    </form>
  </section>

  <section class="form-shell narrow data-tools">
    <div class="form-heading compact-heading">
      <p class="eyebrow">Data</p>
      <h1>Clear duplicates</h1>
    </div>

    <p class="muted">
      Remove repeated imports that match the same film and watched date, keeping the oldest entry.
    </p>

    <form
      class="film-form"
      method="post"
      action="/data/clear-duplicates"
      data-confirm="Remove duplicate film entries? Lumière will keep the oldest entry for each film/date."
    >
      <div class="form-actions">
        <button type="submit">Clear duplicates</button>
      </div>
    </form>
  </section>

  <section class="form-shell narrow danger-zone">
    <div class="form-heading compact-heading">
      <p class="eyebrow">Data</p>
      <h1>Clear diary</h1>
    </div>

    <p class="muted">
      Remove every film entry from Lumière and reset the local database counter.
    </p>

    <form
      class="film-form"
      method="post"
      action="/data/clear"
      data-confirm="Clear all Lumière film data? This cannot be undone."
    >
      <div class="form-actions">
        <button class="danger-button" type="submit">Clear all data</button>
      </div>
    </form>
  </section>
{% endblock %}