Giter Club home page Giter Club logo

Comments (7)

miraclx avatar miraclx commented on May 12, 2024 1

Patch submitted on sindresorhus/filenamify#23

from freyr-js.

Smaltin avatar Smaltin commented on May 12, 2024 1

Works perfectly.

from freyr-js.

miraclx avatar miraclx commented on May 12, 2024

I suppose this is an issue with NTFS' file name formats. I can't tell for sure however but this works on my system (with ext4). We'd need more information to proceed with fixing this. Can you try manually creating the file path?

  • Mori Calliope
    • Your Mori.
      • 01 The Grim Reaper is a Live-Streamer.m4a

from freyr-js.

Smaltin avatar Smaltin commented on May 12, 2024

I suppose this is an issue with NTFS' file name formats.

I created the folder with the name "Your Mori." and it put all the songs into a folder "Your Mori" without the period, seemed to do some weird things. It's most likely a NTFS file format naming thing because it let me delete the "Your Mori." folder but when I create a new folder it renames "Your Mori" to "Your Mori."

This is all pretty wacky, but yeah I don't think folders like having periods in their names. The solution here would probably be running regex on the names of folders (doesn't seem to be a problem with the songs themselves)

function cleanUp(instring) {
    return instring.replace(/[\\/?.:<>|"*]/g, '');
}

from freyr-js.

miraclx avatar miraclx commented on May 12, 2024

freyr already uses filenamify to ensure file and folder names are safe depending on the filesystem, it's exclusion filter [<>:"/\\|?*\u0000-\u001F] doesn't include . (period) so it doesn't filter that out.

However, after seeing https://superuser.com/a/585119/974653, a match on trailing period(s) would make sense.

so this is more of a:

function cleanUp(path) {
    return filenamify(path).replace(/\.+$/, '');
}

I'll do a little more investigating, this patch might actually belong in filenamify itself, so it's better for everyone.

from freyr-js.

Smaltin avatar Smaltin commented on May 12, 2024

I'm guessing this was fixed on c5e7e8c, I'll run a test now.

from freyr-js.

miraclx avatar miraclx commented on May 12, 2024

Yup! You can close this PR at will.

from freyr-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.