aboutsummaryrefslogtreecommitdiffstats
path: root/TODO.md
blob: d55c742cf357f7405085f5d9447cc374b88ddf59 (plain) (blame)
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
109
110
# Future plans for this project:


## Move more things internal

Untouched.

Of the crates currently relied on, the following appear too feature-packed should be replaced with simpler internal code, to reduce binary size.

- duration-str
- urlencoding


## Watermarking

Untouched.

Support for a limited form of (optional) watermaking. It would be up to the themes to include it.

### Query Parameters

- `?watermark` specifies opting-in to the watermark.

### Config Entries

- `LFME_WATERMARK_MANDATORY: 0|1` forces a watermark if `1`. The main instance will not use this, but alternate instances may.
- `LFME_WATERMARK_TEXT: string` should contain the name of the specific instance, or a tagline.
- `LFME_WATERMARK_IMG: string` should contain a link to an image. The rendered size of this image is at the discretion of a given theme, but it should be around 32x32, and have an aspect ratio no greater than 1:2.
- `LFME_WATERMARK_URL: string` should contain a link to the host, or whoever else the watermarker wishes.

### Context Members

- `watermark: object` null, unless `(LFME_WATERMARK_TEXT || LFME_WATERMARK_IMG || LFME_WATERMARK_URL) && (?watermark || LFME_WATERMARK_MANDATORY)`. Should be interpreted as whether to render a watermark.
- `watermark.text` = `LFME_WATERMARK_TEXT`. Defaults to `lfm_embed`.
- `watermark.img` = `LFME_WATERMARK_IMG`. Defaults to null.
- `watermark.url` = `LFME_WATERMARK_URL`. Defaults to null.

All that is guaranteed is the presence of `watermark.text`, so all themes should be able to fallback to text.
Image support should be considered optional. Linking should be considered optional.

It is not an error to specify a mandatory watermark with no possible contents, as the watermark object will simply not be present.
A warning should be output on startup.


## Additional Helpers

Untouched.

- `(range Number start: Number = 0): Number` Generates values from start to the main argument, exclusive.
- `(random): Number` Generates a random float.


## Additional Services to Support

Untouched.

This should be as transparent as possible to the theme and end-user.

### Services

- libre.fm
- listenbrainz
- hacienda if/when it gets off the ground.

### Config Entries

- `LFME_BACKEND_DEFAULT: string` specifies a default backend for /user/ requests..
- `LFME_BACKEND_ADDITIONAL_GNUKEBOX: string,*` specifies a set of additional domains supporting the libre.fm API.
- `LFME_BACKEND_ADDITIONAL_LISTENBRAINZ: string,*` specifies a set of additional domains supporting the listenbrainz API.
- `LFME_BACKEND_ADDITIONAL_AUDIOSCROBBLER: string,*` specifies a set of additional domains supporting the last.fm API.

### Query Parameters

- `?backend=(last.fm|libre.fm|listenbrainz|LFME_BACKEND_ADDITIONAL_*)`

### Context Members

- `user.service` never not null
- `user.service.type` `(audioscrobbler|listenbrainz|gnukebox)`
- `user.service.domain` the string for the service's domain.


## Error Cache

Untouched.

Add support to `lfm_embed::cache::AsyncCache` for caching `Err` values with a different lifetime from `Ok` values.


# Completed Features


## Custom Fonts

Implemented!

### Query Parameters

Each of these are mutually exclusive, and take priority over eachother in the order listed below.
The highest one detected will be handled and others, if present, will be silently ignored.

- `?google_font=` the name of a google font to try loading. If it exists, the `fonts.googleapis.com` stylesheet will end up in `font.css`. The font name will end up in `font.name`.
- `?include_font=` the URL to a font to include. `font.css` will be a generated `@font-family` declaration. A provided name will be in `font.name`.
- `?font=` the name of a browser-native or system font. This will only set `font.name`.

### Context Members

- `font: object` null if no font overrides are present.
- `font.name: string` All text elements should have their font set to this.
- `font.css` If present, it should be placed inside a `<style>` tag somewhere. For legibility of generated HTML, preferably its own tag.