27 lines
1.2 KiB
Python
27 lines
1.2 KiB
Python
from files_utils.files_list import GetFilesDBNodeInfo, GetFilesDBPathInfo, SortFragmentsByStartByte
|
|
from files_utils.files_save import CopyFileFromBytes
|
|
|
|
|
|
def GetSortFragments(files_list: list) -> list:
|
|
path_info = GetFilesDBPathInfo(db_path="./src/db_ntfs_info.db", table_name="db_path", files_path=files_list)
|
|
node_info = GetFilesDBNodeInfo(db_path="./src/db_ntfs_info.db", table_name="db_node", path_records=path_info)
|
|
result = SortFragmentsByStartByte(node_info)
|
|
return result
|
|
|
|
|
|
test_files = [
|
|
r"Y:\CloudMusic\AGA - MIZU.mp3",
|
|
r"Y:\CloudMusic\AGA - 一.mp3",
|
|
r"Y:\CloudMusic\Aaron Zigman - Main Title.mp3",
|
|
r"Y:\CloudMusic\Anson Seabra - Keep Your Head Up Princess.mp3",
|
|
r"Y:\CloudMusic\Anthony Keyrouz,Romy Wave - Something Just Like This (feat. Romy Wave).mp3",
|
|
r"Y:\CloudMusic\Ava Max - Sweet but Psycho.mp3",
|
|
r"Y:\CloudMusic\Cecilia Cheung - Turn Into Fireworks and Fall for You.mp3",
|
|
r"Y:\CloudMusic\Color Music Choir - Something Just Like This (Live).mp3"
|
|
]
|
|
|
|
sort_fragments = GetSortFragments(test_files)
|
|
for item in sort_fragments:
|
|
if item["extent_count"] == 1:
|
|
CopyFileFromBytes(item, target_path=r"Z:\test_files")
|