Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexer writes paths relative to first dir of absolute file paths #21

Open
nahoj opened this issue Jul 8, 2023 · 0 comments
Open

indexer writes paths relative to first dir of absolute file paths #21

nahoj opened this issue Jul 8, 2023 · 0 comments

Comments

@nahoj
Copy link

nahoj commented Jul 8, 2023

Hi. There's an issue with the paths written in an index by tscmd -m indexer : instead of being relative to the location, the path is relative to the first directory in each file's absolute path (e.g. /home/, /media/, etc.).

This does not affect files directly under the location ($location/*).

This happens with both v2.1.53 and v3.0.2, using node.js v16.20.1.

/mnt/test/loc$ tree
.
├── dir
   └── dirfile
└── locfile

1 directory, 2 files
/mnt/test/loc$ tscmd -m indexer .                
Error listing meta directory ./.ts
Error listing meta directory ./dir/.ts
Error listing meta directory ./dir/.ts
Directory index created . containing 3
Saving file: ./.ts/tsi.json
Index persisted for: . to ./.ts/tsi.json
Index generated in folder: .
/mnt/test/loc$ jq . .ts/tsi.json
[
  {
    "uuid": "4d6ab1361bae4a64ad421c3f872169dc",
    "name": "dir",
    "isFile": false,
    "path": "dir",                  // Correct
    "extension": "",
    "tags": []
  },
  {
    "uuid": "9523661dc60c46e9881dbf008caff913",
    "name": "locfile",
    "isFile": true,
    "size": 0,
    "lmdt": 1688810622177,
    "path": "locfile",              // Correct
    "extension": "",
    "tags": []
  },
  {
    "uuid": "63f43a6a66da4e5aabab7f6a8a12910d",
    "name": "dirfile",
    "isFile": true,
    "size": 0,
    "lmdt": 1688810622177,
    "path": "test/loc/dir/dirfile", // Wrong, expected "dir/dirfile"
    "extension": "",
    "tags": []
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant