Use cache dir instead of /tmp

This commit is contained in:
Apeiros-46B 2022-07-15 18:36:42 -07:00
parent 2dc5215390
commit 9c08698b28
2 changed files with 4 additions and 2 deletions

View File

@ -26,6 +26,7 @@ local gobject = require("gears.object")
local gtable = require("gears.table")
local gtimer = require("gears.timer")
local gstring = require("gears.string")
local gfs = require("gears.filesystem")
local beautiful = require("beautiful")
local helpers = require(tostring(...):match(".*bling") .. ".helpers")
local setmetatable = setmetatable
@ -184,7 +185,7 @@ local function emit_player_metadata(self)
callback = function()
if title and title ~= "" then
if art_url ~= "" then
local art_path = "/tmp/bling_album_art/" .. art_url:gsub("https://", ""):gsub("http://", "")
local art_path = gfs.get_cache_dir() .. "bling_album_art/" .. art_url:gsub("https://", ""):gsub("http://", "")
helpers.filesystem.save_image_async_curl(false, true, art_url, art_path, function()
self:emit_signal("metadata", title, artist, art_path, album, player_name)
capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path)

View File

@ -37,6 +37,7 @@ local gobject = require("gears.object")
local gtable = require("gears.table")
local gtimer = require("gears.timer")
local gstring = require("gears.string")
local gfs = require("gears.filesystem")
local beautiful = require("beautiful")
local helpers = require(tostring(...):match(".*bling") .. ".helpers")
local setmetatable = setmetatable
@ -190,7 +191,7 @@ local function emit_metadata_signal(self, title, artist, artUrl, album, new, pla
end
if artUrl ~= "" then
local art_path = "/tmp/bling_album_art/" .. artUrl:gsub("https://", ""):gsub("http://", "")
local art_path = gfs.get_cache_dir() .. "bling_album_art/" .. artUrl:gsub("https://", ""):gsub("http://", "")
helpers.filesystem.save_image_async_curl(false, true, artUrl, art_path, function()
self:emit_signal("metadata", title, artist, art_path, album, new, player_name)
capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path, player_name)