|
1
|
1 /*
|
|
|
2 * Tiny layer for interfacing with beefweb. Does basically the
|
|
|
3 * bare minimum, and does not expose the whole API.
|
|
|
4 *
|
|
|
5 * Copyright (C) 2026 Paper
|
|
|
6 *
|
|
|
7 * This program is free software; you can redistribute it and/or
|
|
|
8 * modify it under the terms of the GNU General Public License
|
|
|
9 * as published by the Free Software Foundation; either version 2
|
|
|
10 * of the License, or (at your option) any later version.
|
|
|
11 *
|
|
|
12 * This program is distributed in the hope that it will be useful,
|
|
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
15 * GNU General Public License for more details.
|
|
|
16 *
|
|
|
17 * You should have received a copy of the GNU General Public License
|
|
|
18 * along with this program; if not, see
|
|
|
19 * <https://www.gnu.org/licenses/>.
|
|
|
20 */
|
|
|
21
|
|
0
|
22 mod player;
|
|
|
23 mod beefweb;
|
|
|
24
|
|
|
25 use std::future;
|
|
|
26
|
|
|
27 #[tokio::main(flavor = "local")]
|
|
|
28 async fn main() -> Result<(), anyhow::Error>
|
|
|
29 {
|
|
|
30 let server = mpris_server::LocalServer::new("org.foobar2000.foobar2000", player::BeefwebPlayer::new("http://127.0.0.1:8880/api", format!("{}/beefweb_mpris", dirs::cache_dir().unwrap().to_str().unwrap()).as_str())).await?;
|
|
|
31
|
|
|
32 tokio::task::spawn_local(server.run());
|
|
|
33
|
|
|
34 future::pending::<()>().await;
|
|
|
35
|
|
|
36 return Ok(());
|
|
|
37 }
|