mac安装Navidrome

mac安装Navidrome

https://www.navidrome.org/docs/installation/macos/

下载

https://github.com/navidrome/navidrome

配置文件

文档: https://www.navidrome.org/docs/usage/configuration-options/

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# https://www.navidrome.org/docs/usage/configuration-options/
MusicFolder = "/Volumes/Data/Music"
DataFolder = "/Volumes/Data/Music/navidrome/data"
ScanSchedule = "@every 10m"
TranscodingCacheSize = "150MiB" # 转码存档的大小
EnableTranscodingConfig = true # 在UI中启动转码配置
EnableExternalServices = false # 外部集成
EnableStarRating = false # 启用星级
EnableFavourites = false # 启动收藏夹
DefaultLanguage = "zh"
# Port = 4533
# CoverArtPriority = "embedded, cover.*, folder.*, front.*"
DefaultTheme = "Spotify-ish"
AutoImportPlaylists = "true" # 启用/禁用.m3u/nsp播放列表自动导入
PlaylistsPath = "navidrome/playlists"
# LogLevel = "error" # info

注意事项:

  1. DataFolderlaunchctl启动程序时不能用相对路径, 如果是用命令行启动, 可以用./data
  2. PlaylistsPath是相对MusicFolder

配置开机后台启动

  1. 添加plist文件

    1
    2
    
      cd ~/Library/LaunchAgents/
      vim navidrome.plist
    
  2. plist 文件内容:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
        <dict>
            <key>Label</key>
            <string>navidrome</string>
            <key>ProgramArguments</key>
            <array>
                <string>/Volumes/Data/Music/navidrome/navidrome</string>
                <string>-c</string>
                <string>/Volumes/Data/Music/navidrome/navidrome.toml</string>
            </array>
            <key>RunAtLoad</key>
            <true/>
            <key>StandardOutPath</key>
            <string>/Volumes/Data/Music/navidrome/navidrome.log</string>
            <key>StandardErrorPath</key>
            <string>/Volumes/Data/Music/navidrome/navidrome.log</string>
        </dict>
    </plist>
    

    注意事项:别添加到/opt/目录, 后面想删除删除不掉

  3. 添加服务

    1
    2
    3
    
    launchctl load navidrome.plist
    # 删除
    launchctl unload navidrome.plist
    

启动服务

1
2
3
launchctl start navidrome
# 停止
launchctl stop navidrome

web页面

http://127.0.0.1:4533

注意事项: 记住账号和密码, 把data删了就把数据清空

(可选)添加智能播放列表

文档: https://github.com/navidrome/navidrome/issues/1417

PlaylistsPath配置的目录下添加文件, 文件名即播放列表的名称, 建议编辑完成再移动进去

参考:

 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
# 最近播放.nsp
vim 最近播放.nsp
#======
{
  "all": [
    {
      "inTheLast": {
        "lastPlayed": 30
      }
    }
  ],
  "sort": "lastPlayed",
  "order": "desc",
  "limit": 100
}
#======

vim 随机.nsp
#======
{
  "all": [
    {
      "gt": {
        "playCount": -1
      }
    }
  ],
  "sort": "random"
}
#======

vim 中文.nsp
#======
{
  "all": [
    {
      "contains": {
        "filepath": "中文"
      }
    }
  ],
  "sort": "title",
  "order": "desc"
}
#======

进入web页面, 点右上角运行情况-->完全扫描就能刷新出播放列表了

可选参数:

  • Current list of fields available (case-insensitive):
 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
title
album
artist
albumartist
hascoverart
tracknumber
discnumber
year
size
compilation
dateadded
datemodified
discsubtitle
comment
lyrics
sorttitle
sortalbum
sortartist
sortalbumartist
albumtype
albumcomment
catalognumber
filepath
filetype
duration
bitrate
bpm
channels
genre
loved
dateloved
lastplayed
playcount
rating
  • Operators available (case-insensitive):
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
is
isNot
gt
lt
contains
notContains
startsWith
endsWith
inTheRange
before
after
inTheLast
notInTheLast

客户端推荐

只推荐试用过的:

缺陷

  • navidrome使用subsonicapi, 无法提供文件夹播放列表
  • 对音乐文件只有只读功能, 无法编辑删除
  • 智能列表功能未完善, 并不能动态监听

优势

  • 自带的web播放器功能不错
  • 只要手机和pc在同个局域网下, 就能共享资源(可通过n2n组网)
build with Hugo, theme Stack, visits 0