A mobile app for listening to radio stations from around the globe
git clone git://soophie.de/verbal
1
import {state} from '../main.js';2
import {http, $lang, $route, duration} from '../utils.js';2
import {http, $lang, $route, duration, utc} from '../utils.js';3
import VButton from '../element/button.js';4
import VTab from '../component/tab.js';5
import VIcon from '../element/icon.js';
28
$lang,29
$route,30
duration,31
utc,32
async show(station) {33
this.station = await http`get::/api/station/${station.id}`();34
if(this.station === null) {
140
<p>{{station.city ? station.city + ', ' : ''}}{{station.state ? station.state + ', ' : ''}}{{station.country}}</p>141
</span>142
<span142
v-if="station.utc"143
v-if="station.utc !== null || station.utc !== undefined"144
class="text-gray-400 inline-flex items-center gap-[5px] w-full sm:w-auto"145
>146
<v-icon
148
class="w-[18px] h-[18px] !min-w-[18px] inline-flex text-gray-400"149
size="100%"150
></v-icon>150
<p>UTC{{station.utc}}</p>151
<p>{{utc(station.utc)}}</p>152
</span>153
<span154
v-if="state.authenticated && station?.playtime && duration(station.playtime ?? 0).length > 0"
118
seconds = seconds - (hours * 3600) - (minutes * 60);119
return `${hours > 0 ? hours + ' h ' : ''}${minutes > 0 ? minutes + ' min' : ''}`;120
}122
export function utc(number) {123
let utc = `${number}`;124
if(number === 0) {125
utc = '+' + utc;126
}127
return `UTC${utc}`;128
}