Eisa01 / mpv-scripts

This repository contain scripts I have made for mpv media player...
BSD 2-Clause "Simplified" License
557 stars 37 forks source link

SmartCopyPaste: Absolute path copy #13

Closed MrSauna closed 3 years ago

MrSauna commented 3 years ago

Feature request

I found the relative path copy quite useless in real scenarios and replaced the function with an absolute path one. I think this could be a valuable addition/modification

Something along these lines:

local function copy_path()
    local filePath = mp.get_property_native('path')
    if (filePath ~= nil) then

        local handle = io.popen("readlink -f "..filePath)
        local result = handle:read("*a")
        handle:close()

        local text = result:sub(1,-2)

        set_clipboard(text)
        mp.osd_message("Copied Video Only:\n"..text)
    else
        return false
    end
end
Eisa01 commented 3 years ago

Thanks, I'll test and see the functionality to determine if changing the use case is worth it

Eisa01 commented 3 years ago

While this code does not support all OS, it also introduces the same problem. Not everyone is gonna like relative path, and absolute path is the same.

I honestly can't think of a good feature to replace it with, I don't use this as well. Maybe someone likes it =/

Closed until I can think of a better replacement.